Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1689: fix_more_as_tests.patch

File fix_more_as_tests.patch, 2.2 kB (added by lifofifo, 10 months ago)

Some more tiny fixes

  • activesupport/test/ordered_options_test.rb

    old new  
    44  def setup 
    55    @keys =   %w( blue   green  red    pink   orange ) 
    66    @values = %w( 000099 009900 aa0000 cc0066 cc6633 ) 
    7     @ordered_hash = ActiveSupport::OrderedHash.new(@keys.zip(@values).to_a) 
     7    @ordered_hash = ActiveSupport::OrderedHash.new 
     8     
     9    @keys.each_with_index do |key, index| 
     10      @ordered_hash[key] = @values[index] 
     11    end 
    812  end 
    913 
    1014  def test_order 
  • activesupport/test/core_ext/enumerable_test.rb

    old new  
    3737  end 
    3838 
    3939  def test_nil_sums 
    40     expected_raise = RUBY_VERSION < '1.9.0' ? TypeError : NoMethodError 
     40    expected_raise = TypeError 
    4141 
    4242    assert_raise(expected_raise) { [5, 15, nil].sum } 
    4343 
  • activesupport/test/core_ext/class/delegating_attributes_test.rb

    old new  
    2525    # The class and instance should have an accessor, but there 
    2626    # should be no mutator 
    2727    assert single_class.respond_to?(:only_reader) 
    28     assert single_class.public_instance_methods.include?("only_reader") 
     28    assert single_class.public_instance_methods.map(&:to_s).include?("only_reader") 
    2929    assert !single_class.respond_to?(:only_reader=) 
    3030  end 
    3131 
     
    4545    # the instance should have an accessor only 
    4646    assert single_class.respond_to?(:both) 
    4747    assert single_class.respond_to?(:both=) 
    48     assert single_class.public_instance_methods.include?("both") 
    49     assert !single_class.public_instance_methods.include?("both=") 
     48    assert single_class.public_instance_methods.map(&:to_s).include?("both") 
     49    assert !single_class.public_instance_methods.map(&:to_s).include?("both=") 
    5050  end 
    5151 
    5252  def test_working_with_simple_attributes