mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 01:14:35 +02:00
- 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
27 lines
431 B
Ruby
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
|