Permalink
Browse files

Trying to whittle down the lines of code for 'given' sections of scen…

…arios.
  • Loading branch information...
1 parent 4d17358 commit b3d1e974467cd3e8d81fbfd11fdf19f2409e1bd6 @technicalpickles committed Feb 20, 2009
@@ -19,26 +19,23 @@ Feature: generating cucumber stories
Scenario: cucumber setup for bacon
Given a working directory
And I have configured git sanely
- And I intend to test with bacon
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
Then 'features/support/env.rb' requires 'test/unit/assertions'
And 'features/support/env.rb' sets up features to use test/unit assertions
Scenario: cucumber setup for minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then 'features/support/env.rb' requires 'mini/test'
And 'features/support/env.rb' sets up features to use minitest assertions
Scenario: cucumber setup for rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then 'features/support/env.rb' requires 'the_perfect_gem'
And 'features/support/env.rb' requires 'spec/expectations'
@@ -17,8 +17,7 @@ Feature: generated directory layout
Scenario: bacon
Given a working directory
And I have configured git sanely
- And I intend to test with bacon
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
Then a directory named 'the-perfect-gem/spec' is created
@@ -28,8 +27,7 @@ Feature: generated directory layout
Scenario: minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then a directory named 'the-perfect-gem/test' is created
@@ -39,8 +37,7 @@ Feature: generated directory layout
Scenario: rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then a directory named 'the-perfect-gem/spec' is created
@@ -50,8 +47,7 @@ Feature: generated directory layout
Scenario: shoulda
Given a working directory
And I have configured git sanely
- And I intend to test with shoulda
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
Then a directory named 'the-perfect-gem/test' is created
@@ -61,8 +57,7 @@ Feature: generated directory layout
Scenario: testunit
Given a working directory
And I have configured git sanely
- And I intend to test with testunit
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
Then a directory named 'the-perfect-gem/test' is created
@@ -38,44 +38,39 @@ Feature: git support
Scenario: bacon
Given a working directory
And I have configured git sanely
- And I intend to test with bacon
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' was checked in
And 'spec/the_perfect_gem_spec.rb' was checked in
Scenario: minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in
Scenario: rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' was checked in
And 'spec/the_perfect_gem_spec.rb' was checked in
Scenario: shoulda
Given a working directory
And I have configured git sanely
- And I intend to test with shoulda
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in
Scenario: testunit
Given a working directory
And I have configured git sanely
- And I intend to test with testunit
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in
@@ -26,8 +26,7 @@ Feature: generated Rakefile
Scenario: minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
@@ -36,16 +35,14 @@ Feature: generated Rakefile
Scenario: rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then Rakefile has 'spec/**/*_spec.rb' in the Spec::Rake::SpecTask pattern
Scenario: shoulda
Given a working directory
And I have configured git sanely
- And I intend to test with shoulda
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
@@ -54,8 +51,7 @@ Feature: generated Rakefile
Scenario: testunit
Given a working directory
And I have configured git sanely
- And I intend to test with testunit
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
@@ -6,22 +6,19 @@ Feature: generated test or spec
Scenario: bacon
Given a working directory
And I have configured git sanely
- And I intend to test with bacon
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem'
Scenario: minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/the_perfect_gem_test.rb' should define 'ThePerfectGemTest' as a subclass of 'Mini::Test::TestCase'
Scenario: rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem'
Scenario: shoulda
@@ -34,7 +31,5 @@ Feature: generated test or spec
Scenario: testunit
Given a working directory
And I have configured git sanely
- And I intend to test with testunit
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/the_perfect_gem_test.rb' should define 'ThePerfectGemTest' as a subclass of 'Test::Unit::TestCase'
-
@@ -6,33 +6,29 @@ Feature: generated test or spec
Scenario: bacon
Given a working directory
And I have configured git sanely
- And I intend to test with bacon
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' requires 'bacon'
And 'spec/spec_helper.rb' requires 'the_perfect_gem'
Scenario: minitest
Given a working directory
And I have configured git sanely
- And I intend to test with minitest
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'mini/test'
And 'test/test_helper.rb' requires 'the_perfect_gem'
And 'test/test_helper.rb' should autorun tests
Scenario: rspec
Given a working directory
And I have configured git sanely
- And I intend to test with rspec
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' requires 'spec'
And 'spec/spec_helper.rb' requires 'the_perfect_gem'
Scenario: shoulda
Given a working directory
And I have configured git sanely
- And I intend to test with shoulda
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'test/unit'
And 'test/test_helper.rb' requires 'shoulda'
And 'test/test_helper.rb' requires 'mocha'
@@ -41,8 +37,7 @@ Feature: generated test or spec
Scenario: testunit
Given a working directory
And I have configured git sanely
- And I intend to test with testunit
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'test/unit'
And 'test/test_helper.rb' requires 'mocha'
And 'test/test_helper.rb' requires 'the_perfect_gem'
@@ -0,0 +1,5 @@
+Feature: I am a placeholder
+
+ Scenario: I am also a placeholder
+ Given a working directory
+
@@ -24,10 +24,16 @@
-When /^I generate a project named '((?:\w|-|_)+)' that is '(.*)'$/ do |name, summary|
+When /^I generate a (.*)project named '((?:\w|-|_)+)' that is '(.*)'$/ do |testing_framework, name, summary|
@name = name
@summary = summary
+ testing_framework = testing_framework.squeeze.strip
+ unless testing_framework.blank?
+ @testing_framework = testing_framework.to_sym
+ end
+
+
@generator = Jeweler::Generator.new(@name,
:directory => "#{@working_dir}/#{@name}",
:summary => @summary,

0 comments on commit b3d1e97

Please sign in to comment.