Class: Sus::Be
- Inherits:
-
Object
- Object
- Sus::Be
- Defined in:
- lib/sus/be.rb
Constant Summary collapse
- NIL =
Be.new(:nil?)
Class Method Summary collapse
- .!=(value) ⇒ Object
- .<(value) ⇒ Object
- .<=(value) ⇒ Object
- .==(value) ⇒ Object
- .===(value) ⇒ Object
- .=~(value) ⇒ Object
- .>(value) ⇒ Object
- .>=(value) ⇒ Object
Instance Method Summary collapse
- #call(assertions, subject) ⇒ Object
-
#initialize(*arguments) ⇒ Be
constructor
A new instance of Be.
- #print(output) ⇒ Object
Constructor Details
#initialize(*arguments) ⇒ Be
Returns a new instance of Be.
8 9 10 |
# File 'lib/sus/be.rb', line 8 def initialize(*arguments) @arguments = arguments end |
Class Method Details
Instance Method Details
#call(assertions, subject) ⇒ Object
18 19 20 21 22 |
# File 'lib/sus/be.rb', line 18 def call(assertions, subject) assertions.nested(self) do |assertions| assertions.assert(subject.public_send(*@arguments)) end end |
#print(output) ⇒ Object
12 13 14 15 16 |
# File 'lib/sus/be.rb', line 12 def print(output) operation, *arguments = *@arguments output.write("be ", :be, operation.to_s, :reset, " ", :variable, arguments.map(&:inspect).join, :reset) end |