Module: RSpecial::Should

Included in:
BasicObject
Defined in:
lib/rspecial/should.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#should(matcher) ⇒ Object

Use should nomenclature for assertions.

10.should be_kind_of(Integer)



14
15
16
# File 'lib/rspecial/should.rb', line 14

def should(matcher)
  matcher =~ self
end

#should=(value) ⇒ Object



30
31
32
# File 'lib/rspecial/should.rb', line 30

def should=(value)
  EqualAssay.assert!(self, value)
end

#should_not(matcher) ⇒ Object

Also, should_not nomenclature for assertions.

10.should_not be_kind_of?(Integer)



23
24
25
# File 'lib/rspecial/should.rb', line 23

def should_not(matcher)
  matcher !~ self
end

#should_not=(value) ⇒ Object



37
38
39
# File 'lib/rspecial/should.rb', line 37

def should_not=(value)
  EqualAssay.refute!(self, value)
end