Class: Sus::BeWithin::Bounded
- Inherits:
-
Object
- Object
- Sus::BeWithin::Bounded
- Defined in:
- lib/sus/be_within.rb
Instance Method Summary collapse
- #call(assertions, subject) ⇒ Object
-
#initialize(range) ⇒ Bounded
constructor
A new instance of Bounded.
- #print(output) ⇒ Object
Constructor Details
#initialize(range) ⇒ Bounded
Returns a new instance of Bounded.
9 10 11 |
# File 'lib/sus/be_within.rb', line 9 def initialize(range) @range = range end |
Instance Method Details
#call(assertions, subject) ⇒ Object
17 18 19 20 21 |
# File 'lib/sus/be_within.rb', line 17 def call(assertions, subject) assertions.nested(self) do |assertions| assertions.assert(@range.include?(subject)) end end |
#print(output) ⇒ Object
13 14 15 |
# File 'lib/sus/be_within.rb', line 13 def print(output) output.write("be within ", :variable, @range, :reset) end |