Created
October 14, 2014 16:05
-
-
Save sunaot/9b2c7868fee2b63e4972 to your computer and use it in GitHub Desktop.
Spock のようななにかを Ruby で。の仮実装。これは spec 側。実装は https://gist.github.com/sunaot/9efce49897e3dbf98fca にあります。
This file contains hidden or 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
class Foo | |
extend Ruby::Spock | |
spec 'maximum of two numbers', ->(*) { | |
expect ->(a, b, c) { [a, b].max == c } | |
where [ | |
# a | b | c | |
[ 1 , 3 , 3 ], | |
[ 7 , 4 , 4 ], | |
[ 0 , 0 , 0 ], | |
] | |
} | |
spec 'minimum of two numbers' do | |
expect ->(a, b, c) { [a, b].min == c } | |
where [ | |
# a | b | c | |
[ 1 , 3 , 1 ], | |
[ 7 , 4 , 4 ], | |
[ 0 , 0 , 0 ], | |
] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment