Sha256: fa49c05c4f41d0578cb94a9375c57f280484862938ff63adf505b604f0794315

Contents?: true

Size: 719 Bytes

Versions: 60

Compression:

Stored size: 719 Bytes

Contents

class Object
  NO_MATCHER_GIVEN = Object.new
  def should(matcher=NO_MATCHER_GIVEN)
    MSpec.expectation
    MSpec.actions :expectation, MSpec.current.state
    unless matcher.equal?(NO_MATCHER_GIVEN)
      unless matcher.matches?(self)
        SpecExpectation.fail_with(*matcher.failure_message)
      end
    else
      SpecPositiveOperatorMatcher.new(self)
    end
  end

  def should_not(matcher=NO_MATCHER_GIVEN)
    MSpec.expectation
    MSpec.actions :expectation, MSpec.current.state
    unless matcher.equal?(NO_MATCHER_GIVEN)
      if matcher.matches?(self)
        SpecExpectation.fail_with(*matcher.negative_failure_message)
      end
    else
      SpecNegativeOperatorMatcher.new(self)
    end
  end
end

Version data entries

60 entries across 60 versions & 3 rubygems

Version Path
rhodes-5.5.18 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.17 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.15 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.0.22 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.2 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.0.7 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.0.3 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-5.5.0 lib/extensions/mspec/mspec/expectations/should.rb
tauplatform-1.0.3 lib/extensions/mspec/mspec/expectations/should.rb
mspec-1.9.1 lib/mspec/expectations/should.rb
mspec-1.9.0 lib/mspec/expectations/should.rb
tauplatform-1.0.2 lib/extensions/mspec/mspec/expectations/should.rb
tauplatform-1.0.1 lib/extensions/mspec/mspec/expectations/should.rb
mspec-1.8.0 lib/mspec/expectations/should.rb
mspec-1.7.0 lib/mspec/expectations/should.rb
mspec-1.6.0 lib/mspec/expectations/should.rb
mspec-1.5.21 lib/mspec/expectations/should.rb
mspec-1.5.20 lib/mspec/expectations/should.rb
mspec-1.5.19 lib/mspec/expectations/should.rb
mspec-1.5.18 lib/mspec/expectations/should.rb