module SuperDiff::RSpec

Public Class Methods

a_collection_containing_exactly_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 50
def self.a_collection_containing_exactly_something?(value)
  fuzzy_object?(value) &&
    value.base_matcher.is_a?(::RSpec::Matchers::BuiltIn::ContainExactly)
end
a_collection_including_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 35
def self.a_collection_including_something?(value)
  fuzzy_object?(value) &&
    value.respond_to?(:expecteds) &&
    !(value.expecteds.one? && value.expecteds.first.is_a?(::Hash))
end
a_hash_including_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 22
def self.a_hash_including_something?(value)
  fuzzy_object?(value) &&
    value.respond_to?(:expecteds) &&
    value.expecteds.one? &&
    value.expecteds.first.is_a?(::Hash)
end
a_kind_of_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 55
def self.a_kind_of_something?(value)
  fuzzy_object?(value) &&
    value.base_matcher.is_a?(::RSpec::Matchers::BuiltIn::BeAKindOf)
end
a_value_within_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 77
def self.a_value_within_something?(value)
  fuzzy_object?(value) &&
    value.base_matcher.is_a?(::RSpec::Matchers::BuiltIn::BeWithin)
end
an_instance_of_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 66
def self.an_instance_of_something?(value)
  fuzzy_object?(value) &&
    value.base_matcher.is_a?(::RSpec::Matchers::BuiltIn::BeAnInstanceOf)
end
an_object_having_some_attributes?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 45
def self.an_object_having_some_attributes?(value)
  fuzzy_object?(value) &&
    value.base_matcher.is_a?(::RSpec::Matchers::BuiltIn::HaveAttributes)
end
array_including_something?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 41
def self.array_including_something?(value)
  value.is_a?(::RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher)
end
configuration() click to toggle source
# File lib/super_diff/rspec.rb, line 18
def self.configuration
  SuperDiff.configuration
end
configure(&block) click to toggle source
# File lib/super_diff/rspec.rb, line 14
def self.configure(&block)
  SuperDiff.configure(&block)
end
fuzzy_object?(value) click to toggle source
# File lib/super_diff/rspec.rb, line 82
def self.fuzzy_object?(value)
  value.is_a?(::RSpec::Matchers::AliasedMatcher)
end
hash_including_something?(value) click to toggle source

HINT: `a_hash_including` is an alias of `include` in the rspec-expectations gem.

`hash_including` is an argument matcher in the rspec-mocks gem.
# File lib/super_diff/rspec.rb, line 31
def self.hash_including_something?(value)
  value.is_a?(::RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher)
end
instance_of_something?(value) click to toggle source

HINT: `an_instance_of` is a matcher in the rspec-expectations gem.

`instance_of` is an argument matcher in the rspec-mocks gem.
# File lib/super_diff/rspec.rb, line 73
def self.instance_of_something?(value)
  value.is_a?(::RSpec::Mocks::ArgumentMatchers::InstanceOf)
end
kind_of_something?(value) click to toggle source

HINT: `a_kind_of` is a matcher in the rspec-expectations gem.

`kind_of` is an argument matcher in the rspec-mocks gem.
# File lib/super_diff/rspec.rb, line 62
def self.kind_of_something?(value)
  value.is_a?(::RSpec::Mocks::ArgumentMatchers::KindOf)
end
rspec_version() click to toggle source
# File lib/super_diff/rspec.rb, line 86
def self.rspec_version
  @_rspec_version ||= begin
    require "rspec/core/version"
    GemVersion.new(::RSpec::Core::Version::STRING)
  end
end