Skip to content

Commit

Permalink
work on features, began implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
cfeduke committed Oct 24, 2011
1 parent bf4325d commit 985f771
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 16 deletions.
17 changes: 3 additions & 14 deletions features/deal_one_card.feature → features/deal.feature
@@ -1,4 +1,4 @@
Feature: dealer deals a card
Feature: dealer deals cards

As a card dealer
I want to deal a card
Expand All @@ -8,23 +8,12 @@ Feature: dealer deals a card
And there are 0 or more cards remaining
When I deal a card
Then I should be dealt a card

Feature: dealer has an empty deck

As a card dealer
When the deck is out of cards
I shouldn't be able to deal any more cards


Scenario: deal no cards
Given I have a deck of 0 cards
When I deal a card
Then I should not be dealt a card

Feature: dealer deals all cards

As a card dealer
I want to deal all cards


Scenario: deal all cards
Given I have a deck of 52 randomly ordered cards
When I deal a card 52 times
Expand Down
11 changes: 11 additions & 0 deletions features/deck.feature
@@ -0,0 +1,11 @@
Feature: system creates deck of cards

As the system
I want to create a deck of 52 playing cards

@wip
Scenario: create a deck of 52 playing cards
Given I do not yet have a deck of cards
When I create a new deck of cards
Then I should have a deck with 52 cards
And they should have Ace, 2-10, Jack, Queen, King in four suits
1 change: 0 additions & 1 deletion features/shuffle.feature
Expand Up @@ -3,7 +3,6 @@ Feature: dealer shuffles cards
As a card dealer
I want to shuffle the deck

@wip
Scenario: shuffle deck
Given I have a deck of 52 ordered cards
When I shuffle the deck
Expand Down
15 changes: 15 additions & 0 deletions features/step_definitions/deck_of_cards_steps.rb
@@ -0,0 +1,15 @@
Given /^I do not yet have a deck of cards$/ do
@deck = nil
end

When /^I create a new deck of cards$/ do
@deck = Deck.new
end

Then /^I should have a deck with 52 cards$/ do
pending # express the regexp above with the code you wish you had
end

Then /^they should have Ace, 2-10, Jack, Queen, King in four suits$/ do
pending # express the regexp above with the code you wish you had
end
3 changes: 2 additions & 1 deletion features/support/env.rb
@@ -1 +1,2 @@
$LOAD_PATH << File.expand_path('../../../lib', __FILE__)
$LOAD_PATH << File.expand_path('../../../lib', __FILE__)
require 'deck_of_cards'
2 changes: 2 additions & 0 deletions lib/deck_of_cards.rb
@@ -0,0 +1,2 @@
require 'deck_of_cards/deck.rb'
require 'deck_of_cards/card.rb'
Empty file added lib/deck_of_cards/card.rb
Empty file.
2 changes: 2 additions & 0 deletions lib/deck_of_cards/deck.rb
@@ -0,0 +1,2 @@
class Deck
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
@@ -0,0 +1 @@
require 'deck_of_cards'

0 comments on commit 985f771

Please sign in to comment.