class TestAttributeMatcher

Public Instance Methods

setup() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 7
def setup
  @test = {}
  @matcher = Test::Unit::AttributeMatcher.new(@test)
end
test_and() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 21
def test_and
  @test[:slow] = true
  @test[:important] = true
  assert_true(@matcher.match?("important and slow"))
end
test_complex() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 27
def test_complex
  @test[:tags] = [:slow, :web]
  @test[:bug] = "2929"
  assert_true(@matcher.match?("tags.include?(:web) or bug == '29'"))
end
test_exception() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 33
def test_exception
  assert_raise(NoMethodError) do
    @matcher.match?("nonexistent > 100")
  end
end
test_existent() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 16
def test_existent
  @test[:existent] = true
  assert_true(@matcher.match?("existent"))
end
test_nonexistent() click to toggle source
# File test-unit-3.3.4/test/test-attribute-matcher.rb, line 12
def test_nonexistent
  assert_false(@matcher.match?("nonexistent"))
end