Class: Sus::BeWithin::Bounded

Inherits:
Object
  • Object
show all
Defined in:
lib/sus/be_within.rb

Instance Method Summary collapse

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


13
14
15
# File 'lib/sus/be_within.rb', line 13

def print(output)
	output.write("be within ", :variable, @range, :reset)
end