From 1d737aea2c1c3cf08837a50c79830e42686420fe Mon Sep 17 00:00:00 2001 From: Ryan Wiedemann Date: Fri, 28 Jul 2017 03:37:46 -0600 Subject: [PATCH 1/2] Check for VERSION on BookKeeping module Fixes #696 --- .../binary_search_tree_test.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/exercises/binary-search-tree/binary_search_tree_test.rb b/exercises/binary-search-tree/binary_search_tree_test.rb index d64d6ff4b2..4a4c2b0fd1 100644 --- a/exercises/binary-search-tree/binary_search_tree_test.rb +++ b/exercises/binary-search-tree/binary_search_tree_test.rb @@ -99,16 +99,25 @@ def test_each_returns_enumerator_if_no_block assert_raises(StopIteration) { each_enumerator.next } end - # Problems in exercism evolve over time, - # as we find better ways to ask questions. + # 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 Bst. + # Define a constant named VERSION inside of the top level BookKeeping + # module, which may be placed near the end of your file. + # + # 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, Bst::VERSION + assert_equal 1, BookKeeping::VERSION end end From b3e2d34535d42dc1fea5b3d04a6b2243e6091648 Mon Sep 17 00:00:00 2001 From: Ryan Wiedemann Date: Fri, 28 Jul 2017 14:15:02 -0600 Subject: [PATCH 2/2] Update binary_search_tree solution --- .../.meta/solutions/binary_search_tree.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/binary-search-tree/.meta/solutions/binary_search_tree.rb b/exercises/binary-search-tree/.meta/solutions/binary_search_tree.rb index a20df75355..7970a5740a 100644 --- a/exercises/binary-search-tree/.meta/solutions/binary_search_tree.rb +++ b/exercises/binary-search-tree/.meta/solutions/binary_search_tree.rb @@ -1,6 +1,4 @@ class Bst - VERSION = 1 - attr_reader :data, :left, :right def initialize(data) @data = data @@ -43,3 +41,7 @@ def insert_right(value) end end end + +module BookKeeping + VERSION = 1 +end