aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/core_ext/struct_test.rb
blob: 0dff7b32d23ae0ad3ea17924a40e6e98c9545df1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                            
require 'abstract_unit'
require 'active_support/core_ext/struct'

class StructExt < ActiveSupport::TestCase
  def test_to_h
    x = Struct.new(:foo, :bar)
    z = x.new(1, 2)
    assert_equal({ foo: 1, bar: 2 }, z.to_h)
  end
end