Sha256: fb1699da5b69554c2a300095bd8ffc7aab400aa9c19e08c0fcd72facd7d8078a

Contents?: true

Size: 798 Bytes

Versions: 136

Compression:

Stored size: 798 Bytes

Contents

require 'test/unit'
require 'testunit-test-util'

class TestAttributeMatcher < Test::Unit::TestCase
  include TestUnitTestUtil

  def setup
    @test = {}
    @matcher = Test::Unit::AttributeMatcher.new(@test)
  end

  def test_nonexistent
    assert_false(@matcher.match?("nonexistent"))
  end

  def test_existent
    @test[:existent] = true
    assert_true(@matcher.match?("existent"))
  end

  def test_and
    @test[:slow] = true
    @test[:important] = true
    assert_true(@matcher.match?("important and slow"))
  end

  def test_complex
    @test[:tags] = [:slow, :web]
    @test[:bug] = "2929"
    assert_true(@matcher.match?("tags.include?(:web) or bug == '29'"))
  end

  def test_exception
    assert_raise(NoMethodError) do
      @matcher.match?("nonexistent > 100")
    end
  end
end

Version data entries

136 entries across 106 versions & 10 rubygems

Version Path
postfinancecheckout-ruby-sdk-4.5.0 vendor/bundle/ruby/3.3.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-4.5.0 vendor/bundle/ruby/3.3.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-4.4.0 vendor/bundle/ruby/3.1.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-4.4.0 vendor/bundle/ruby/3.1.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-4.2.0 vendor/bundle/ruby/3.0.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-4.2.0 vendor/bundle/ruby/3.0.0/gems/test-unit-3.3.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-3.3.0 vendor/bundle/ruby/2.7.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-3.3.0 vendor/bundle/ruby/2.7.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.2.1 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-3.2.0 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-3.2.0 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
wallee-ruby-sdk-3.1.5 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-3.1.5 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.2.0 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.1.9 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.1.8 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.1.7 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.1.6 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
whitelabelmachinename-ruby-sdk-3.1.5 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb
postfinancecheckout-ruby-sdk-3.1.4 vendor/bundle/ruby/2.4.0/gems/test-unit-3.2.9/test/test-attribute-matcher.rb