markdown/readme/named_values/example.rb in test_values-0.3.0 vs markdown/readme/named_values/example.rb in test_values-0.4.0

- old
+ new

@@ -1,9 +1,11 @@ require 'minitest/autorun' require 'test_values' +require_relative 'my_items' + class MyTest < Minitest::Test def test_bad_item_length items = MyItems.new values = StringValues.strings_not_in_length_range((4..8)) @@ -15,23 +17,8 @@ items.add_item(value) end puts "Got exception #{e.inspect}" end - end - -end - -class MyItems - - attr_accessor :items - - def initialize - self.items = [] - end - - def add_item(item) - raise ArgumentError.new(item) unless (4..8).include?(item.length) - items.push(item) end end