Sha256: 19bb12df8d5e8b819b3fcd062475d76a54be5809d6702096fcb4b94e49926968

Contents?: true

Size: 587 Bytes

Versions: 126

Compression:

Stored size: 587 Bytes

Contents

class Object
  def should(matcher=nil)
    MSpec.expectation
    MSpec.actions :expectation, MSpec.current.state
    if matcher
      unless matcher.matches?(self)
        Expectation.fail_with(*matcher.failure_message)
      end
    else
      PositiveOperatorMatcher.new(self)
    end
  end

  def should_not(matcher=nil)
    MSpec.expectation
    MSpec.actions :expectation, MSpec.current.state
    if matcher
      if matcher.matches?(self)
        Expectation.fail_with(*matcher.negative_failure_message)
      end
    else
      NegativeOperatorMatcher.new(self)
    end
  end
end

Version data entries

126 entries across 102 versions & 3 rubygems

Version Path
rhodes-3.1.1 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.1.beta lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0.beta.5 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0.beta.4 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0.beta.3 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0.beta.2 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.1.0.beta.1 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.2 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.2.beta.1 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.8 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.7 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.6 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.5 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.4 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.3 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.1.beta.2 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.0 lib/extensions/mspec/mspec/expectations/should.rb
rhodes-3.0.0.beta.7 lib/extensions/mspec/mspec/expectations/should.rb