Project

General

Profile

Feature #9614 » 0001-adjust-tests-to-account-for-unsorted-methods.patch

normalperson (Eric Wong), 03/09/2014 02:22 AM

View differences:

test/ruby/test_module.rb
(class << self ; self ; end).class_eval do
define_method :method_added do |sym|
memo << sym
memo << mod.instance_methods(false)
memo << mod.instance_methods(false).sort
memo << (mod.instance_method(sym) rescue nil)
end
end
......
assert_equal [:f, :g], memo.shift
assert_equal mod.instance_method(:f), memo.shift
assert_equal :a, memo.shift
assert_equal [:f, :g, :a], memo.shift
assert_equal [:a, :f, :g], memo.shift
assert_equal mod.instance_method(:a), memo.shift
assert_equal :a=, memo.shift
assert_equal [:f, :g, :a, :a=], memo.shift
assert_equal [:a, :a=, :f, :g], memo.shift
assert_equal mod.instance_method(:a=), memo.shift
end
test/ruby/test_struct.rb
assert_equal("#<struct :@a=3>", o.inspect)
methods = klass.instance_methods(false)
assert_equal([:@a, :"@a="].inspect, methods.inspect, '[Bug #8756]')
assert_equal([:@a, :"@a="].inspect, methods.sort.inspect, '[Bug #8756]')
assert_include(methods, :@a)
assert_include(methods, :"@a=")
end
(1-1/4)