Created
January 25, 2016 00:41
-
-
Save PharaohKJ/9b49fa5bd7df5b624680 to your computer and use it in GitHub Desktop.
rspecでboolean値をテストする
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_boolean do | |
match do |actual| | |
expect(actual).to satisfy { |x| x == true || x == false } | |
end | |
end | |
it 'is boolean' do | |
expect(true).to be_boolean | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment