Skip to content

Commit

Permalink
Trying to whittle down the lines of code for 'given' sections of scen…
Browse files Browse the repository at this point in the history
…arios.
  • Loading branch information
technicalpickles committed Feb 20, 2009
1 parent 4d17358 commit b3d1e97
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 54 deletions.
9 changes: 3 additions & 6 deletions features/generator/cucumber.feature
Expand Up @@ -19,26 +19,23 @@ Feature: generating cucumber stories
Scenario: cucumber setup for bacon Scenario: cucumber setup for bacon
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with bacon When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'features/support/env.rb' requires 'test/unit/assertions' Then 'features/support/env.rb' requires 'test/unit/assertions'
And 'features/support/env.rb' sets up features to use test/unit assertions And 'features/support/env.rb' sets up features to use test/unit assertions


Scenario: cucumber setup for minitest Scenario: cucumber setup for minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'features/support/env.rb' requires 'mini/test' Then 'features/support/env.rb' requires 'mini/test'
And 'features/support/env.rb' sets up features to use minitest assertions And 'features/support/env.rb' sets up features to use minitest assertions


Scenario: cucumber setup for rspec Scenario: cucumber setup for rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'features/support/env.rb' requires 'the_perfect_gem' Then 'features/support/env.rb' requires 'the_perfect_gem'
And 'features/support/env.rb' requires 'spec/expectations' And 'features/support/env.rb' requires 'spec/expectations'
15 changes: 5 additions & 10 deletions features/generator/directory_layout.feature
Expand Up @@ -17,8 +17,7 @@ Feature: generated directory layout
Scenario: bacon Scenario: bacon
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with bacon When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then a directory named 'the-perfect-gem/spec' is created Then a directory named 'the-perfect-gem/spec' is created


Expand All @@ -28,8 +27,7 @@ Feature: generated directory layout
Scenario: minitest Scenario: minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then a directory named 'the-perfect-gem/test' is created Then a directory named 'the-perfect-gem/test' is created


Expand All @@ -39,8 +37,7 @@ Feature: generated directory layout
Scenario: rspec Scenario: rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then a directory named 'the-perfect-gem/spec' is created Then a directory named 'the-perfect-gem/spec' is created


Expand All @@ -50,8 +47,7 @@ Feature: generated directory layout
Scenario: shoulda Scenario: shoulda
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with shoulda When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then a directory named 'the-perfect-gem/test' is created Then a directory named 'the-perfect-gem/test' is created


Expand All @@ -61,8 +57,7 @@ Feature: generated directory layout
Scenario: testunit Scenario: testunit
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with testunit When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then a directory named 'the-perfect-gem/test' is created Then a directory named 'the-perfect-gem/test' is created


Expand Down
15 changes: 5 additions & 10 deletions features/generator/git.feature
Expand Up @@ -38,44 +38,39 @@ Feature: git support
Scenario: bacon Scenario: bacon
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with bacon When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'spec/spec_helper.rb' was checked in Then 'spec/spec_helper.rb' was checked in
And 'spec/the_perfect_gem_spec.rb' was checked in And 'spec/the_perfect_gem_spec.rb' was checked in


Scenario: minitest Scenario: minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'test/test_helper.rb' was checked in Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in And 'test/the_perfect_gem_test.rb' was checked in


Scenario: rspec Scenario: rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'spec/spec_helper.rb' was checked in Then 'spec/spec_helper.rb' was checked in
And 'spec/the_perfect_gem_spec.rb' was checked in And 'spec/the_perfect_gem_spec.rb' was checked in


Scenario: shoulda Scenario: shoulda
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with shoulda When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'test/test_helper.rb' was checked in Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in And 'test/the_perfect_gem_test.rb' was checked in


Scenario: testunit Scenario: testunit
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with testunit When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then 'test/test_helper.rb' was checked in Then 'test/test_helper.rb' was checked in
And 'test/the_perfect_gem_test.rb' was checked in And 'test/the_perfect_gem_test.rb' was checked in
Expand Down
12 changes: 4 additions & 8 deletions features/generator/rakefile.feature
Expand Up @@ -26,8 +26,7 @@ Feature: generated Rakefile
Scenario: minitest Scenario: minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
Expand All @@ -36,16 +35,14 @@ Feature: generated Rakefile
Scenario: rspec Scenario: rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then Rakefile has 'spec/**/*_spec.rb' in the Spec::Rake::SpecTask pattern Then Rakefile has 'spec/**/*_spec.rb' in the Spec::Rake::SpecTask pattern


Scenario: shoulda Scenario: shoulda
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with shoulda When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
Expand All @@ -54,8 +51,7 @@ Feature: generated Rakefile
Scenario: testunit Scenario: testunit
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with testunit When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'


Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern Then Rakefile has 'test/**/*_test.rb' in the Rake::TestTask pattern
And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern And Rakefile has 'test/**/*_test.rb' in the Rcov::RcovTask test_pattern
Expand Down
13 changes: 4 additions & 9 deletions features/generator/test.feature
Expand Up @@ -6,22 +6,19 @@ Feature: generated test or spec
Scenario: bacon Scenario: bacon
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with bacon When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem' Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem'


Scenario: minitest Scenario: minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a 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' Then 'test/the_perfect_gem_test.rb' should define 'ThePerfectGemTest' as a subclass of 'Mini::Test::TestCase'


Scenario: rspec Scenario: rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem' Then 'spec/the_perfect_gem_spec.rb' should describe 'ThePerfectGem'


Scenario: shoulda Scenario: shoulda
Expand All @@ -34,7 +31,5 @@ Feature: generated test or spec
Scenario: testunit Scenario: testunit
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with testunit When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a 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' Then 'test/the_perfect_gem_test.rb' should define 'ThePerfectGemTest' as a subclass of 'Test::Unit::TestCase'

15 changes: 5 additions & 10 deletions features/generator/test_helper.feature
Expand Up @@ -6,33 +6,29 @@ Feature: generated test or spec
Scenario: bacon Scenario: bacon
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with bacon When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' requires 'bacon' Then 'spec/spec_helper.rb' requires 'bacon'
And 'spec/spec_helper.rb' requires 'the_perfect_gem' And 'spec/spec_helper.rb' requires 'the_perfect_gem'


Scenario: minitest Scenario: minitest
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with minitest When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'mini/test' Then 'test/test_helper.rb' requires 'mini/test'
And 'test/test_helper.rb' requires 'the_perfect_gem' And 'test/test_helper.rb' requires 'the_perfect_gem'
And 'test/test_helper.rb' should autorun tests And 'test/test_helper.rb' should autorun tests


Scenario: rspec Scenario: rspec
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with rspec When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'spec/spec_helper.rb' requires 'spec' Then 'spec/spec_helper.rb' requires 'spec'
And 'spec/spec_helper.rb' requires 'the_perfect_gem' And 'spec/spec_helper.rb' requires 'the_perfect_gem'


Scenario: shoulda Scenario: shoulda
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with shoulda When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'test/unit' Then 'test/test_helper.rb' requires 'test/unit'
And 'test/test_helper.rb' requires 'shoulda' And 'test/test_helper.rb' requires 'shoulda'
And 'test/test_helper.rb' requires 'mocha' And 'test/test_helper.rb' requires 'mocha'
Expand All @@ -41,8 +37,7 @@ Feature: generated test or spec
Scenario: testunit Scenario: testunit
Given a working directory Given a working directory
And I have configured git sanely And I have configured git sanely
And I intend to test with testunit When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
Then 'test/test_helper.rb' requires 'test/unit' Then 'test/test_helper.rb' requires 'test/unit'
And 'test/test_helper.rb' requires 'mocha' And 'test/test_helper.rb' requires 'mocha'
And 'test/test_helper.rb' requires 'the_perfect_gem' And 'test/test_helper.rb' requires 'the_perfect_gem'
5 changes: 5 additions & 0 deletions features/placeholder.feature
@@ -0,0 +1,5 @@
Feature: I am a placeholder

Scenario: I am also a placeholder
Given a working directory

8 changes: 7 additions & 1 deletion features/step_definitions/generator_steps.rb
Expand Up @@ -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 @name = name
@summary = summary @summary = summary


testing_framework = testing_framework.squeeze.strip
unless testing_framework.blank?
@testing_framework = testing_framework.to_sym
end


@generator = Jeweler::Generator.new(@name, @generator = Jeweler::Generator.new(@name,
:directory => "#{@working_dir}/#{@name}", :directory => "#{@working_dir}/#{@name}",
:summary => @summary, :summary => @summary,
Expand Down

0 comments on commit b3d1e97

Please sign in to comment.