%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/ruby/2.7.8/lib64/ruby/gems/2.7.0/gems/test-unit-3.3.4/test/
Upload File :
Create Path :
Current File : //opt/plesk/ruby/2.7.8/lib64/ruby/gems/2.7.0/gems/test-unit-3.3.4/test/test-attribute-matcher.rb

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

Zerion Mini Shell 1.0