Files
klayout/testdata/vendor/ruby/test/unit/attribute-matcher.rb
T
Matthias Koefferlein 585d0941bb RBA Unit test enhancements
- Include a copy of the unit test framework so we're no longer
  depending on incompatible versions for Ruby 1 and 2.
- Avoid duplication of path entries in unit tests
2017-07-23 23:03:21 +02:00

27 lines
431 B
Ruby

module Test
module Unit
class AttributeMatcher
def initialize(test)
@test = test
end
def match?(expression)
matched = instance_eval(expression)
if matched.nil?
false
else
matched
end
end
def method_missing(name, *args)
if args.empty?
@test[name]
else
super
end
end
end
end
end