module RSpecial::Should

The Should module is included into BasicObject to provide the needed assertion interface that RSpec utilizes. Namely, the ‘should` and `should_not` methods.

Public Instance Methods

should(matcher) click to toggle source

Use ‘should` nomenclature for assertions.

10.should be_kind_of(Integer)
# File lib/rspecial/should.rb, line 14
def should(matcher)
  matcher =~ self
end
should=(value) click to toggle source
# File lib/rspecial/should.rb, line 30
def should=(value)
  EqualAssay.assert!(self, value)
end
should_not(matcher) click to toggle source

Also, ‘should_not` nomenclature for assertions.

10.should_not be_kind_of?(Integer)
# File lib/rspecial/should.rb, line 23
def should_not(matcher)
  matcher !~ self
end
should_not=(value) click to toggle source
# File lib/rspecial/should.rb, line 37
def should_not=(value)
  EqualAssay.refute!(self, value)
end