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 Hand | |
| def straight? | |
| values = @cards.map{|card| card.value}.uniq.sort | |
| values.unshift 1 if values.include?(14) # ace can be low | |
| 0.upto(values.length - 5) do |i| | |
| return true if values[i] + 4 == values[i + 4] | |
| end | |
| false | |
| end | |
| end |
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
| describe "#my_method" do | |
| before do | |
| @blog_post = FactoryGirl.create(:blog_post) | |
| end | |
| it "should do something" do | |
| @blog_post.title.should == 'mytitle' | |
| end | |
| end |