-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRY up the cucumber step definitions
- Loading branch information
Showing
5 changed files
with
36 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
When(/^I add a failing test$/) do | ||
`cp features/support/templates/FailingSpec.mm template-project/Specs/ExampleSpec.mm` | ||
end | ||
|
||
When(/^I reference AppDelegate in the test$/) do | ||
`cp features/support/templates/ExampleSpec.mm template-project/Specs` | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Then(/^the `rake Specs` should work$/) do | ||
Dir.chdir('template-project/Specs') do | ||
output = `rake Specs 2> /dev/null` | ||
if $? != 0 | ||
puts "!!! Spec target failed. Build output:" | ||
puts output | ||
end | ||
$?.exitstatus.should eq(0) | ||
end | ||
end | ||
|
||
Then(/^running the specs from the rake task should fail$/) do | ||
Dir.chdir('template-project/Specs') do | ||
`rake Specs 2> /dev/null` | ||
$?.exitstatus.should_not eq(0) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
When(/^I add an (iOS|OS X) Spec (suite|bundle) target$/) do |os, target_type| | ||
`open -a Xcode template-project/template-project.xcodeproj` | ||
`osascript features/support/scripts/#{os.downcase.gsub(/\s+/, '')}_add_spec_#{target_type.downcase.gsub(/\s+/, '')}.scpt` | ||
File.exist?("template-project/Specs").should be_true | ||
end | ||
|
||
Given(/^an Xcode (iOS|OS X) project$/) do |os| | ||
`rm -rf template-project` | ||
`cp -pr features/support/#{os.downcase.gsub(/\s+/, '')}-project-template template-project` | ||
$?.exitstatus.should == 0 | ||
File.exist?("template-project").should be_true | ||
end |