Skip to content

Commit

Permalink
Passing pull features
Browse files Browse the repository at this point in the history
  • Loading branch information
stewart committed Sep 11, 2013
1 parent 261b21c commit 63ebadc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
26 changes: 20 additions & 6 deletions features/step_definitions/gitnesse_steps.rb
@@ -1,20 +1,34 @@
Given(/^there is a wiki with Cucumber features defined$/) do
pending # express the regexp above with the code you wish you had
@wiki_dir = File.join(Dir.home, ".gitnesse/_features/wiki_with_features")
end

Given(/^there is a wiki with no Cucumber features defined$/) do
pending # express the regexp above with the code you wish you had
@wiki_dir = File.join(Dir.home, ".gitnesse/_features/wiki_without_features")
end

Given(/^there are no local features$/) do
pending # express the regexp above with the code you wish you had
@repo_dir = File.join(Dir.home, ".gitnesse/_features/repo_without_features")
end

Given(/^there are local features$/) do
pending # express the regexp above with the code you wish you had
@repo_dir = File.join(Dir.home, ".gitnesse/_features/repo_with_features")
end

Then(/^the local features should match the wiki$/) do
pending # express the regexp above with the code you wish you had
end
@assertion_dir = File.join(Dir.home, ".gitnesse/_features/assert")

system "git clone #{@wiki_dir} #{@assertion_dir} &> /dev/null"

wiki_features = Dir.glob("#{@assertion_dir}/**/*.feature.md")
repo_features = Dir.glob("#{@repo_dir}/features/**/*.feature")

wiki_features.map! { |f| File.basename(f, ".md") }
repo_features.map! { |f| File.basename(f) }

FileUtils.rm_rf(@assertion_dir)
FileUtils.mkdir_p(@assertion_dir)

wiki_features.each do |feature|
expect(repo_features).to include feature
end
end
4 changes: 3 additions & 1 deletion features/step_definitions/pull_steps.rb
@@ -1,3 +1,5 @@
When(/^I pull features$/) do
pending
Dir.chdir(@repo_dir) do
system "gitnesse pull &> /dev/null"
end
end
3 changes: 2 additions & 1 deletion features/support/env.rb
Expand Up @@ -17,9 +17,10 @@
@wiki_without_features = File.join(@root, "/wiki_without_features")
@repo_with_features = File.join(@root, "/repo_with_features")
@repo_without_features = File.join(@root, "/repo_without_features")
@assertion_dir = File.join(@root, "/assertion")

dirs = [@wiki_with_features, @wiki_without_features, @repo_with_features,
@repo_without_features]
@repo_without_features, @assertion_dir]

dirs.each do |dir|
FileUtils.rm_rf dir
Expand Down

0 comments on commit 63ebadc

Please sign in to comment.