Created
September 4, 2012 07:56
-
-
Save rojotek/3618228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :be_less_than do |expected| | |
match do |actual| | |
result = actual<expected | |
result &&=actual>@low_value unless @low_value.nil? | |
result | |
end | |
chain :and_greater_than do |low_value| | |
@low_value=low_value | |
end | |
description do | |
result = "should be less than #{expected}" | |
result += " and greater than #{@low_value}" if @low_value | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment