Sha256: 1e0e6eff3c099a937db63a359eebcb35b2dd0fbf42816be326fe75d4fcf363c7

Contents?: true

Size: 651 Bytes

Versions: 7

Compression:

Stored size: 651 Bytes

Contents

require 'test/unit'
require_relative '../../lib/array_logic'

module ArrayLogic
  class TestCase < Test::Unit::TestCase
    
    def self.things
      @things ||= Thing.make(10)
    end
    
    def get_things(thing_ids)
      @things = thing_ids.collect{|id| self.class.things[id]}
    end
    
    def assert_thing_match(thing_ids, rule)
      get_things(thing_ids)
      assert(rule.match(@things), "#{thing_ids.inspect} should match '#{rule.rule}'")
    end
    
    def assert_no_thing_match(thing_ids, rule)
      get_things(thing_ids)
      assert(!rule.match(@things), "#{thing_ids.inspect} should not match '#{rule.rule}'")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
array_logic-0.1.0 test/array_logic/test_case.rb
array_logic-0.0.6 test/array_logic/test_case.rb
array_logic-0.0.5 test/array_logic/test_case.rb
array_logic-0.0.4 test/array_logic/test_case.rb
array_logic-0.0.3 test/array_logic/test_case.rb
array_logic-0.0.2 test/array_logic/test_case.rb
array_logic-0.0.1 test/array_logic/test_case.rb