File Manager

Current Path : /usr/lib/ruby/gems/3.0.0/gems/test-unit-3.3.7/lib/test/unit/
Upload File :
Current File : //usr/lib/ruby/gems/3.0.0/gems/test-unit-3.3.7/lib/test/unit/attribute-matcher.rb

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

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com