Sha256: 597fb7f2a74ec8d2e7fb98278facdcbf6c15623ea0965b5fabc50bf738dcf168

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

require 'test_belt/matchers/base'
require 'test_belt/matchers/have_instance_methods'
require 'test_belt/matchers/have_class_methods'
require 'test_belt/matchers/have_readers'
require 'test_belt/matchers/have_writers'
require 'test_belt/matchers/have_accessors'
require 'test_belt/matchers/have_files'

module TestBelt::Matchers

  # Test Belt provides matchers to test common scenarios.  Use these matchers
  # in combination with the 'should' method to run common test cases.

  def self.included(receiving_test_class)
    if receiving_test_class.ancestors.include?(::Test::Unit::TestCase)
      receiving_test_class.send(:include, HaveInstanceMethods)
      receiving_test_class.send(:include, HaveClassMethods)
      receiving_test_class.send(:include, HaveReaders)
      receiving_test_class.send(:include, HaveWriters)
      receiving_test_class.send(:include, HaveAccessors)
      receiving_test_class.send(:include, HaveFiles)
    end
  end

  def assert_matcher(matcher)
    instance_exec(*matcher.args, &matcher.test)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
test-belt-2.0.1 lib/test_belt/matchers.rb
test-belt-2.0.0 lib/test_belt/matchers.rb
test-belt-1.1.2 lib/test_belt/matchers.rb
test-belt-1.1.1 lib/test_belt/matchers.rb
test-belt-1.1.0 lib/test_belt/matchers.rb