Sha256: 532f7b27580b7bf04bfd2f363f61ede5ce90db7dcdd18fb046e8ce334858e54a

Contents?: true

Size: 823 Bytes

Versions: 1

Compression:

Stored size: 823 Bytes

Contents

require "rubygems"
require "bundler/setup"

require "introspection"
require "minitest/autorun"

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 Minitest::Test
  include Introspection::TestHelper
  include Introspection::LocalAssertions
  include Introspection::Assertions
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
introspection-0.0.4 test/test_helper.rb