Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial steps and specs for our new FeatureFile class, which wi…
…ll handle the manipulation of our cucumber features.
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: We need a way to handle out feature files | ||
# Main goal of this project | ||
In order to improve the way we handle feature imports | ||
As Salad | ||
I want to be able to read feature files and store its information | ||
|
||
Scenario: A FeatureFile can gives an error if the file referenced is not a cucumber feature file | ||
Given we create a FeatureFile from a none cucumber feature file | ||
Then the object should be invalid | ||
|
||
Scenario: A FeatureFile should be valid if the file references is a cucumber file | ||
Given we create a FeatureFile from a cucumber feature file | ||
Then the object should be valid | ||
|
||
Scenario: A FeatureFile should store the 'Feature' heading | ||
Given we create a FeatureFile from a cucumber feature file | ||
Then the object should be valid | ||
And the feature property should not be null | ||
|
||
Scenario: A FeatureFile should store the 'In order' heading | ||
Scenario: A FeatureFile should store the 'I want' heading | ||
Scenario: A FeatureFile should store the feature files scenario's |
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,19 @@ | ||
Given /^we create a FeatureFile from a none cucumber feature file$/ do | ||
@file = FeatureFile.new("#{RAILS_ROOT}/fixtures/project.yml") | ||
end | ||
|
||
Given /^we create a FeatureFile from a cucumber feature file$/ do | ||
@file = FeatureFile.new("#{RAILS_ROOT}/fixtures/test.feature") | ||
end | ||
|
||
Then /^the object should be valid$/ do | ||
@file.should_not be_invalid | ||
end | ||
|
||
Then /^the feature property should not be null$/ do | ||
pending # express the regexp above with the code you wish you had | ||
end | ||
|
||
Then /^the object should be invalid$/ do | ||
@file.should be_invalid | ||
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,15 @@ | ||
class FeatureFile < File | ||
@file = nil | ||
|
||
def initialize featureFile | ||
@file = featureFile | ||
end | ||
|
||
def invalid? | ||
if @file =~ /^(.*).feature$/ | ||
false | ||
else | ||
true | ||
end | ||
end | ||
end |