diff --git a/exercises/accumulate/accumulate_test.rb b/exercises/accumulate/accumulate_test.rb index f8df83e6ee..eb0e41fe82 100755 --- a/exercises/accumulate/accumulate_test.rb +++ b/exercises/accumulate/accumulate_test.rb @@ -45,4 +45,25 @@ def test_do_not_change_in_place original.accumulate { |n| n * n } assert_equal copy, original end + + # Problems in exercism evolve over time, as we find better ways to ask + # questions. + # The version number refers to the version of the problem you solved, + # not your solution. + # + # Define a constant named VERSION inside of the top level BookKeeping + # module. + # In your file, it will look like this: + # + # module BookKeeping + # VERSION = 1 # Where the version number matches the one in the test. + # end + # + # If you are curious, read more about constants on RubyDoc: + # http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html + + def test_bookkeeping + skip + assert_equal 1, BookKeeping::VERSION + end end diff --git a/exercises/accumulate/example.rb b/exercises/accumulate/example.rb index 3128b76618..a0db800ef4 100644 --- a/exercises/accumulate/example.rb +++ b/exercises/accumulate/example.rb @@ -1,3 +1,7 @@ +module BookKeeping + VERSION = 1 +end + class Array def accumulate result = []