Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renaming ruby-warrior directory to rubywarrior so it goes with gem name
- Loading branch information
Showing
10 changed files
with
61 additions
and
36 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
Feature: Command Options | ||
In order to play the game the way I want | ||
As a player | ||
I want to customize ruby-warrior with options | ||
I want to customize rubywarrior with options | ||
|
||
Background: | ||
Given no profile at "tmp" | ||
|
||
Scenario: Run ruby warrior in specified directory with -d option | ||
Given a profile named "Joe" on "beginner" | ||
When I copy fixture "walking_player.rb" to "tmp/ruby-warrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/ruby-warrior/joe-beginner -t 0" | ||
When I copy fixture "walking_player.rb" to "tmp/rubywarrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/rubywarrior/joe-beginner -t 0" | ||
And I answer "y" to "next level" | ||
Then I should see "the updated README in the ruby-warrior/joe-beginner directory" | ||
Then I should see "the updated README in the rubywarrior/joe-beginner directory" | ||
|
||
Scenario: Skip user input with -s option | ||
Given a profile named "Joe" on "beginner" | ||
When I copy fixture "walking_player.rb" to "tmp/ruby-warrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/ruby-warrior/joe-beginner -t 0 -s" | ||
When I copy fixture "walking_player.rb" to "tmp/rubywarrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/rubywarrior/joe-beginner -t 0 -s" | ||
Then I should see "current level" | ||
When I run rubywarrior with options "-d tmp/ruby-warrior/joe-beginner -t 0" | ||
When I run rubywarrior with options "-d tmp/rubywarrior/joe-beginner -t 0" | ||
And I answer "y" to "next level" | ||
Then I should see "the updated README in the ruby-warrior/joe-beginner directory" | ||
When I run rubywarrior with options "-d tmp/ruby-warrior/joe-beginner -t 0 -s" | ||
Then I should see "the updated README in the rubywarrior/joe-beginner directory" | ||
When I run rubywarrior with options "-d tmp/rubywarrior/joe-beginner -t 0 -s" | ||
Then I should see "failed level 2" | ||
|
||
Scenario: Unable to practice level if not epic | ||
Given a profile named "Joe" on "beginner" | ||
When I copy fixture "walking_player.rb" to "tmp/ruby-warrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/ruby-warrior/joe-beginner -l 2" | ||
When I copy fixture "walking_player.rb" to "tmp/rubywarrior/joe-beginner/player.rb" | ||
And I run rubywarrior with options "-d tmp/rubywarrior/joe-beginner -l 2" | ||
Then I should see "Unable" | ||
|
||
Scenario: Practice specific level when epic | ||
When I copy fixture "short-tower" to "towers/short" | ||
Given a profile named "Bill" on "short" | ||
When I copy fixture "walking_player.rb" to "tmp/ruby-warrior/bill-short/player.rb" | ||
When I copy fixture "walking_player.rb" to "tmp/rubywarrior/bill-short/player.rb" | ||
And I run rubywarrior | ||
And I choose "Bill - short - level 1" for "profile" | ||
Then I answer "y" to "next level" | ||
And I should see "the updated README in the ruby-warrior/bill-short directory" | ||
And I should see "the updated README in the rubywarrior/bill-short directory" | ||
When I run rubywarrior | ||
And I choose "Bill - short - level 2" for "profile" | ||
Then I answer "y" to "epic" | ||
And I should see "epic mode" | ||
When I run rubywarrior with options "-d tmp/ruby-warrior/bill-short -l 2" | ||
When I run rubywarrior with options "-d tmp/rubywarrior/bill-short -l 2" | ||
Then I should not see "Level 1" before "Total Score: 17" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
Given /^a directory at "([^\"]*)"$/ do |path| | ||
Dir.mkdir(path) unless File.exist? path | ||
end | ||
|
||
Given /^no directory at "([^\"]*)"$/ do |path| | ||
Dir.rmdir(path) if File.exist? path | ||
end | ||
|
||
When /^I copy fixture "([^\"]*)" to "([^\"]*)"$/ do |from, to| | ||
FileUtils.cp_r("spec/fixtures/" + from, to) | ||
end | ||
|
||
Then /^I should find file at "([^\"]*)"$/ do |path| | ||
File.exist?(path).should be_true | ||
end | ||
|
||
Then /^I should find no file at "([^\"]*)"$/ do |path| | ||
File.exist?(path).should be_false | ||
end |
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
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
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
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
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