Skip to content

Commit

Permalink
accumulate: add bookkeeping (#489)
Browse files Browse the repository at this point in the history
Add the bookkeeping module to accumulate_test.rb
Add bookkeeping to example.rb
  • Loading branch information
raadler authored and Insti committed Nov 24, 2016
1 parent 1940663 commit 32469e4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions exercises/accumulate/accumulate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions exercises/accumulate/example.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module BookKeeping
VERSION = 1
end

class Array
def accumulate
result = []
Expand Down

0 comments on commit 32469e4

Please sign in to comment.