Sha256: 68558528fe14b8ad62f2e319be5311a61faac349098e0a4e2e35abbb651e9823

Contents?: true

Size: 821 Bytes

Versions: 3

Compression:

Stored size: 821 Bytes

Contents

require "rubygems"
require "bundler/setup"

require "introspection"
require "test/unit"

module Introspection
  module TestHelper
    def for_all_method_visibilities(&block)
      [:public, :protected, :private].each do |visibility|
        block.call(visibility)
      end
    end
  end
  module LocalAssertions
    def assert_method_exists(object, owner, method_name, visibility)
      snapshot = Snapshot.new(object)
      method = owner.instance_method(method_name)
      expected_method = Method.new(method, visibility)
      methods_for_name = snapshot.methods.select { |m| m.name == method_name }
      assert_equal [expected_method], methods_for_name
    end
  end
end

class Test::Unit::TestCase
  include Introspection::TestHelper
  include Introspection::LocalAssertions
  include Introspection::Assertions
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
introspection-0.0.3 test/test_helper.rb
introspection-0.0.2 test/test_helper.rb
introspection-0.0.1 test/test_helper.rb