Skip to content

Instantly share code, notes, and snippets.

View bakineggs's full-sized avatar

Dan Barry bakineggs

View GitHub Profile
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
@bakineggs
bakineggs / hand.rb
Created December 16, 2008 05:46 — forked from imownbey/hand.rb
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