Implement only MyHelper module and make the tests pass. Good luck.
View Code RUBY
require 'test/unit' module MyHelper end class Foo BAR = 1 NORM = 3 include MyHelper end class Baz BAR = 2 NORM = 4 include MyHelper end class MyTest < Test::Unit::TestCase def test_Foo foo = Foo.new assert_equal(1, foo.score) assert_equal(1, Foo.bar) assert_equal(1, foo.bar) assert_equal(3, Foo.norm) assert_equal(3, foo.norm) end def test_Baz baz = Baz.new assert_equal(2, baz.score) assert_equal(2, Baz.bar) assert_equal(2, baz.bar) assert_equal(4, Baz.norm) assert_equal(4, baz.norm) end end |
Social Networking