newgem 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. data/History.txt +9 -0
  2. data/Manifest.txt +9 -1
  3. data/Rakefile +2 -1
  4. data/TODO.markdown +9 -3
  5. data/app_generators/newgem/newgem_generator.rb +5 -1
  6. data/app_generators/newgem/templates/README.rdoc +1 -1
  7. data/app_generators/newgem/templates/Rakefile +2 -1
  8. data/app_generators/newgem_simple/templates/Rakefile +1 -1
  9. data/bin/newgem +1 -1
  10. data/features/development.feature +5 -5
  11. data/features/executable_generator.feature +46 -29
  12. data/features/extconf.feature +27 -26
  13. data/features/install_cucumber.feature +29 -19
  14. data/features/install_website.feature +6 -6
  15. data/features/newgem_cli.feature +86 -42
  16. data/features/rubygem_tasks.feature +26 -18
  17. data/features/step_definitions/cli_steps.rb +22 -17
  18. data/features/step_definitions/common_steps.rb +45 -67
  19. data/features/step_definitions/rubygems_steps.rb +1 -1
  20. data/features/support/cli.rb +8 -0
  21. data/features/support/common.rb +29 -0
  22. data/features/support/env.rb +2 -7
  23. data/features/support/matchers.rb +11 -0
  24. data/lib/newgem.rb +1 -1
  25. data/lib/newgem/rubyforge-ext.rb +1 -1
  26. data/newgem_generators/install_website/install_website_generator.rb +1 -1
  27. data/newgem_generators/install_website/templates/features/website.feature +4 -4
  28. data/newgem_theme_generators/long_box_theme/long_box_theme_generator.rb +1 -1
  29. data/rubygems_generators/executable/executable_generator.rb +1 -1
  30. data/rubygems_generators/executable/templates/spec/cli_spec.rb.erb +2 -2
  31. data/rubygems_generators/executable/templates/test/test_cli.rb.erb +2 -2
  32. data/rubygems_generators/extconf/extconf_generator.rb +1 -1
  33. data/rubygems_generators/install_cucumber/install_cucumber_generator.rb +2 -0
  34. data/rubygems_generators/install_cucumber/templates/features/development.feature +5 -5
  35. data/rubygems_generators/install_cucumber/templates/features/step_definitions/common_steps.rb +45 -67
  36. data/rubygems_generators/install_cucumber/templates/features/support/common.rb +29 -0
  37. data/rubygems_generators/install_rspec/install_rspec_generator.rb +1 -1
  38. data/rubygems_generators/install_rspec/templates/spec.rb +1 -1
  39. data/rubygems_generators/install_rspec/templates/spec/spec_helper.rb +1 -1
  40. data/rubygems_generators/install_rspec/templates/tasks/rspec.rake +1 -1
  41. data/rubygems_generators/install_shoulda/USAGE +5 -0
  42. data/rubygems_generators/install_shoulda/install_shoulda_generator.rb +35 -0
  43. data/rubygems_generators/install_shoulda/templates/tasks/shoulda.rake +15 -0
  44. data/rubygems_generators/install_shoulda/templates/test/test.rb +13 -0
  45. data/rubygems_generators/install_shoulda/templates/test/test_helper.rb +9 -0
  46. data/rubygems_generators/install_test_unit/install_test_unit_generator.rb +1 -1
  47. data/script/destroy +1 -1
  48. data/script/generate +1 -1
  49. data/test/test_generator_helper.rb +1 -1
  50. data/website/index.html +2 -2
  51. data/website/rubyforge.html +2 -2
  52. metadata +21 -6
  53. data/features/expected_outputs/newgem.out +0 -27
@@ -1,3 +1,12 @@
1
+ == 1.4.0 2009-05-02
2
+
3
+ * install_shoulda - use "newgem -T shoulda" to use shoulda for testing instead of test_unit or rspec
4
+ * common_steps.rb - When steps all started with 'I ...'
5
+ * common.rb - using module instead of creating methods against global namespace; no more kittens killed [thx Ben Mabey]
6
+ * all +require 'rubygems'+ are conditional unless ENV['NO_RUBYGEMS'] [thx David Chelimsky + Ryan Tomayko]
7
+ * module_name supports hyphens throughout all generators (they are treated as underscores for camelize method)
8
+ * common_steps.rb - using "(.*)" for placeholders which is now cucumber defacto standard
9
+
1
10
  == 1.3.0 2009-03-17
2
11
 
3
12
  * install_cucumber: using layout like Rails' cucumber generator: features/support/env.rb + features/step_definitions/common_steps.rb
@@ -34,7 +34,6 @@ cucumber_generators/feature/templates/feature.erb
34
34
  cucumber_generators/feature/templates/steps.erb
35
35
  features/development.feature
36
36
  features/executable_generator.feature
37
- features/expected_outputs/newgem.out
38
37
  features/extconf.feature
39
38
  features/install_cucumber.feature
40
39
  features/install_website.feature
@@ -43,7 +42,10 @@ features/rubygem_tasks.feature
43
42
  features/step_definitions/cli_steps.rb
44
43
  features/step_definitions/common_steps.rb
45
44
  features/step_definitions/rubygems_steps.rb
45
+ features/support/cli.rb
46
+ features/support/common.rb
46
47
  features/support/env.rb
48
+ features/support/matchers.rb
47
49
  lib/hoe-patched.rb
48
50
  lib/newgem.rb
49
51
  lib/newgem/quick_template.rb
@@ -91,6 +93,7 @@ rubygems_generators/install_cucumber/USAGE
91
93
  rubygems_generators/install_cucumber/install_cucumber_generator.rb
92
94
  rubygems_generators/install_cucumber/templates/features/development.feature
93
95
  rubygems_generators/install_cucumber/templates/features/step_definitions/common_steps.rb
96
+ rubygems_generators/install_cucumber/templates/features/support/common.rb
94
97
  rubygems_generators/install_cucumber/templates/features/support/env.rb.erb
95
98
  rubygems_generators/install_jruby/USAGE
96
99
  rubygems_generators/install_jruby/install_jruby_generator.rb
@@ -101,6 +104,11 @@ rubygems_generators/install_rspec/templates/spec.rb
101
104
  rubygems_generators/install_rspec/templates/spec/spec.opts
102
105
  rubygems_generators/install_rspec/templates/spec/spec_helper.rb
103
106
  rubygems_generators/install_rspec/templates/tasks/rspec.rake
107
+ rubygems_generators/install_shoulda/USAGE
108
+ rubygems_generators/install_shoulda/install_shoulda_generator.rb
109
+ rubygems_generators/install_shoulda/templates/tasks/shoulda.rake
110
+ rubygems_generators/install_shoulda/templates/test/test.rb
111
+ rubygems_generators/install_shoulda/templates/test/test_helper.rb
104
112
  rubygems_generators/install_test_unit/USAGE
105
113
  rubygems_generators/install_test_unit/install_test_unit_generator.rb
106
114
  rubygems_generators/install_test_unit/templates/test/test.rb
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
- %w[rubygems rake rake/clean fileutils rubigen].each { |f| require f }
1
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
2
+ %w[rake rake/clean fileutils rubigen].each { |f| require f }
2
3
  require File.dirname(__FILE__) + '/lib/newgem'
3
4
 
4
5
  # Generate all the Rake tasks
@@ -1,5 +1,11 @@
1
- ## install_cucumber
1
+ ## post_rubyflow
2
2
 
3
- * don't generate tasks/cucumber.rake since its already loaded from newgem
3
+ Code blocks:
4
+ * use <code>
5
+ * indent spaces must be &nbsp;
4
6
 
5
- ## Rakefile
7
+ Need title + method description
8
+
9
+ Probably need to move away from current History.txt paragraph parsing
10
+
11
+ Store rubyflow login details in .hoerc or .rubyforge?
@@ -17,7 +17,7 @@ class NewgemGenerator < RubiGen::Base
17
17
 
18
18
 
19
19
  attr_reader :gem_name, :module_name, :project_name
20
- attr_reader :version, :version_str, :author, :email
20
+ attr_reader :version, :version_str, :author, :email, :project_url
21
21
 
22
22
  # extensions/option
23
23
  attr_reader :test_framework
@@ -33,6 +33,8 @@ class NewgemGenerator < RubiGen::Base
33
33
  @gem_name = base_name
34
34
  @module_name = gem_name.gsub('-','_').camelize
35
35
  @project_name = @gem_name
36
+ @github_username = 'FIXME'
37
+ @project_url = 'http://github.com/#{github_username}/#{project_name}'
36
38
  extract_options
37
39
  end
38
40
 
@@ -60,6 +62,8 @@ class NewgemGenerator < RubiGen::Base
60
62
  m.dependency "install_test_unit", [gem_name], :destination => destination_root, :collision => :force
61
63
  when "rspec"
62
64
  m.dependency "install_rspec", [gem_name], :destination => destination_root, :collision => :force
65
+ when "shoulda"
66
+ m.dependency "install_shoulda", [gem_name], :destination => destination_root, :collision => :force
63
67
  end
64
68
 
65
69
  # Website
@@ -1,6 +1,6 @@
1
1
  = <%= gem_name %>
2
2
 
3
- * FIX (url)
3
+ * <%= project_url %>
4
4
 
5
5
  == DESCRIPTION:
6
6
 
@@ -1,4 +1,5 @@
1
- %w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
1
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
2
+ %w[rake rake/clean fileutils newgem rubigen].each { |f| require f }
2
3
  require File.dirname(__FILE__) + '/lib/<%= gem_name %>'
3
4
 
4
5
  # Generate all the Rake tasks
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
2
2
  require 'rake/gempackagetask'
3
3
  require 'rubygems/specification'
4
4
  require 'date'
data/bin/newgem CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rubygems'
3
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
4
4
  require 'rubigen'
5
5
 
6
6
  if %w(-v --version).include? ARGV.first
@@ -6,8 +6,8 @@ Feature: Development processes of newgem itself (rake tasks)
6
6
 
7
7
  Scenario: Generate RubyGem
8
8
  Given this project is active project folder
9
- And 'pkg' folder is deleted
10
- When task 'rake gem' is invoked
11
- Then folder 'pkg' is created
12
- And file with name matching 'pkg/*.gem' is created else you should run "rake manifest" to fix this
13
- And gem spec key 'rdoc_options' contains /--mainREADME.rdoc/
9
+ And "pkg" folder is deleted
10
+ When I invoke task "rake gem"
11
+ Then folder "pkg" is created
12
+ And file with name matching "pkg/*.gem" is created else you should run "rake manifest" to fix this
13
+ And gem spec key "rdoc_options" contains /--mainREADME.rdoc/
@@ -5,42 +5,59 @@ Feature: Generate an executable/CLI scaffold
5
5
  So that I know the structure for constructing CLIs and can create them quickly
6
6
 
7
7
  Scenario: Run executable generator with name of executable
8
- Given an existing newgem scaffold [called 'my_project']
9
- When 'executable' generator is invoked with arguments 'my_app'
10
- Then folder 'bin/my_app' is created
11
- And file 'bin/my_app' is created
12
- And file 'lib/my_app/cli.rb' is created
13
- And file 'test/test_my_app_cli.rb' is created
8
+ Given an existing newgem scaffold [called "my_project"]
9
+ When I invoke "executable" generator with arguments "my_app"
10
+ Then folder "bin/my_app" is created
11
+ And file "bin/my_app" is created
12
+ And file "lib/my_app/cli.rb" is created
13
+ And file "test/test_my_app_cli.rb" is created
14
+ When I run unit tests for test file "test/test_my_app_cli.rb"
15
+ Then I should see all 1 tests pass
14
16
 
15
17
  Scenario: Run executable generator with name of executable on rspec project
16
- Given an existing newgem scaffold using options '-T rspec' [called 'my_project']
17
- When 'executable' generator is invoked with arguments 'my_app'
18
- Then folder 'bin/my_app' is created
19
- And file 'bin/my_app' is created
20
- And file 'lib/my_app/cli.rb' is created
21
- And file 'spec/my_app_cli_spec.rb' is created
18
+ Given an existing newgem scaffold using options "-T rspec" [called "my_project"]
19
+ When I invoke "executable" generator with arguments "my_app"
20
+ Then folder "bin/my_app" is created
21
+ And file "bin/my_app" is created
22
+ And file "lib/my_app/cli.rb" is created
23
+ And file "spec/my_app_cli_spec.rb" is created
24
+ When I enable rspec autorun
25
+ And I run unit tests for test file "spec/my_app_cli_spec.rb"
26
+ Then I should see all 1 examples pass
27
+
28
+ Scenario: Run executable generator with name of executable on shoulda project
29
+ Given an existing newgem scaffold using options "-T shoulda" [called "my_project"]
30
+ When I invoke "executable" generator with arguments "my_app"
31
+ Then folder "bin/my_app" is created
32
+ And file "bin/my_app" is created
33
+ And file "lib/my_app/cli.rb" is created
34
+ And file "test/test_my_app_cli.rb" is created
22
35
 
23
36
  Scenario: Run CLI app from executable generator to show help
24
- Given an existing newgem scaffold [called 'my_project']
25
- Given 'executable' generator is invoked with arguments 'my_app'
26
- When run project executable 'bin/my_app' with arguments '-h'
27
- Then help options '-h' and '--help' are displayed
28
- Then help options '-p' and '--path' are displayed
37
+ Given an existing newgem scaffold [called "my_project"]
38
+ Given I invoke "executable" generator with arguments "my_app"
39
+ When I run project executable "bin/my_app" with arguments "-h"
40
+ Then help options "-h" and "--help" are displayed
41
+ Then help options "-p" and "--path" are displayed
29
42
 
30
43
  Scenario: Run CLI app from executable generator should not fail
31
- Given an existing newgem scaffold [called 'my_project']
32
- Given 'executable' generator is invoked with arguments 'my_app'
33
- When run project executable 'bin/my_app' with arguments ''
34
- Then output does match /lib\/my_app\/cli.rb/
44
+ Given an existing newgem scaffold [called "my_project"]
45
+ And I invoke "executable" generator with arguments "my_app"
46
+ When I run project executable "bin/my_app" with arguments ""
47
+ Then I should see
48
+ """
49
+ lib/my_app/cli.rb
50
+ """
35
51
 
36
52
  Scenario: Run unit tests after executable generator should all pass for test/unit
37
- Given an existing newgem scaffold [called 'my_project']
38
- And 'executable' generator is invoked with arguments 'my_app'
39
- When run unit tests for test file 'test/test_my_app_cli.rb'
40
- Then all 1 tests pass
53
+ Given an existing newgem scaffold [called "my_project"]
54
+ And I invoke "executable" generator with arguments "my_app"
55
+ When I run unit tests for test file "test/test_my_app_cli.rb"
56
+ Then I should see all 1 tests pass
41
57
 
42
58
  Scenario: Run examples after executable generator should all pass for rspec
43
- Given an existing newgem scaffold using options '-T rspec' [called 'my_project']
44
- And 'executable' generator is invoked with arguments 'my_app'
45
- When run unit tests for test file 'spec/my_app_cli_spec.rb'
46
- Then all 1 examples pass
59
+ Given an existing newgem scaffold using options "-T rspec" [called "my_project"]
60
+ And I invoke "executable" generator with arguments "my_app"
61
+ When I enable rspec autorun
62
+ And I run unit tests for test file "spec/my_app_cli_spec.rb"
63
+ Then I should see all 1 examples pass
@@ -4,35 +4,36 @@ Feature: Write and test C-extensions
4
4
  I want to generate a scaffold with test/spec support for writing Ruby C-extensions
5
5
 
6
6
  Scenario: Run extconf generator with name of extension
7
- Given an existing newgem scaffold [called 'my_project']
8
- When 'extconf' generator is invoked with arguments 'my_ext'
9
- Then folder 'ext/my_ext' is created
10
- And file 'ext/my_ext/extconf.rb' is created
11
- And file 'ext/my_ext/my_ext.c' is created
12
- And file 'test/test_my_ext_extn.rb' is created
13
- And file '.autotest' is created
14
- And contents of file '.autotest' does match /test\/test_.*_extn\.rb/
7
+ Given an existing newgem scaffold [called "my_project"]
8
+ When I invoke "extconf" generator with arguments "my_ext"
9
+ Then folder "ext/my_ext" is created
10
+ And file "ext/my_ext/extconf.rb" is created
11
+ And file "ext/my_ext/my_ext.c" is created
12
+ And file "test/test_my_ext_extn.rb" is created
13
+ And file ".autotest" is created
14
+ And file ".autotest" contents does match /test\/test_.*_extn\.rb/
15
15
 
16
16
  Scenario: Run extconf generator with name of extension on rspec project
17
- Given an existing newgem scaffold using options '-T rspec' [called 'my_project']
18
- When 'extconf' generator is invoked with arguments 'my_ext'
19
- Then folder 'ext/my_ext' is created
20
- And file 'ext/my_ext/extconf.rb' is created
21
- And file 'ext/my_ext/my_ext.c' is created
22
- And file 'spec/my_ext_extn_spec.rb' is created
23
- And file '.autotest' is created
24
- And contents of file '.autotest' does match /spec\/.*_extn_spec\.rb/
17
+ Given an existing newgem scaffold using options "-T rspec" [called "my_project"]
18
+ When I invoke "extconf" generator with arguments "my_ext"
19
+ Then folder "ext/my_ext" is created
20
+ And file "ext/my_ext/extconf.rb" is created
21
+ And file "ext/my_ext/my_ext.c" is created
22
+ And file "spec/my_ext_extn_spec.rb" is created
23
+ And file ".autotest" is created
24
+ And file ".autotest" contents does match /spec\/.*_extn_spec\.rb/
25
25
 
26
26
  Scenario: Run unit tests after executable generator should all pass for test/unit
27
- Given an existing newgem scaffold [called 'my_project']
28
- And 'extconf' generator is invoked with arguments 'my_ext'
29
- When task 'rake compile' is invoked
30
- And run unit tests for test file 'test/test_my_ext_extn.rb'
31
- Then all 1 tests pass
27
+ Given an existing newgem scaffold [called "my_project"]
28
+ And I invoke "extconf" generator with arguments "my_ext"
29
+ When I invoke task "rake compile"
30
+ And I run unit tests for test file "test/test_my_ext_extn.rb"
31
+ Then I should see all 1 tests pass
32
32
 
33
33
  Scenario: Run examples after executable generator should all pass for rspec
34
- Given an existing newgem scaffold using options '-T rspec' [called 'my_project']
35
- And 'extconf' generator is invoked with arguments 'my_ext'
36
- When task 'rake compile' is invoked
37
- And run unit tests for test file 'spec/my_ext_extn_spec.rb'
38
- Then all 1 examples pass
34
+ Given an existing newgem scaffold using options "-T rspec" [called "my_project"]
35
+ And I invoke "extconf" generator with arguments "my_ext"
36
+ When I invoke task "rake compile"
37
+ And I enable rspec autorun
38
+ And I run unit tests for test file "spec/my_ext_extn_spec.rb"
39
+ Then I should see all 1 examples pass
@@ -1,29 +1,39 @@
1
1
  Feature: RubyGems have features to be described and tested
2
2
 
3
3
  As a RubyGem developer
4
- I want to describe the project's features using Cucumber
4
+ I want to describe the project"s features using Cucumber
5
5
  So that I can describe each feature of the project in readable text
6
6
 
7
7
  Scenario: Install Cucumber into a RubyGem
8
- Given an existing newgem scaffold [called 'my_project']
9
- When 'install_cucumber' generator is invoked with arguments ''
10
- Then folder 'features/step_definitions' is created
11
- Then folder 'features/support' is created
12
- And file 'features/development.feature' is created
13
- And file 'features/support/env.rb' is created
14
- And file 'features/step_definitions/common_steps.rb' is created
15
- And file 'tasks/cucumber.rake' is not created as it is loaded via newgem itself
8
+ Given default env variables setup for name and email
9
+ And an existing newgem scaffold [called "my_project"]
10
+ When I invoke "install_cucumber" generator with arguments ""
11
+ Then folder "features/step_definitions" is created
12
+ Then folder "features/support" is created
13
+ And file "features/development.feature" is created
14
+ And file "features/support/env.rb" is created
15
+ And file "features/support/common.rb" is created
16
+ And file "features/support/matchers.rb" is created
17
+ And file "features/step_definitions/common_steps.rb" is created
18
+ And file "tasks/cucumber.rake" is not created as it is loaded via newgem itself
16
19
 
17
20
  Scenario: NewGem and generated gems should share some common files
18
- Given an existing newgem scaffold [called 'my_project']
19
- When 'install_cucumber' generator is invoked with arguments ''
20
- Then gem file 'features/step_definitions/common_steps.rb' and generated file 'features/step_definitions/common_steps.rb' should be the same
21
- Then gem file 'features/development.feature' and generated file 'features/development.feature' should be the same
21
+ Given default env variables setup for name and email
22
+ And an existing newgem scaffold [called "my_project"]
23
+ When I invoke "install_cucumber" generator with arguments ""
24
+ Then gem file "features/step_definitions/common_steps.rb" and generated file "features/step_definitions/common_steps.rb" should be the same
25
+ Then gem file "features/support/common.rb" and generated file "features/support/common.rb" should be the same
26
+ Then gem file "features/support/matchers.rb" and generated file "features/support/matchers.rb" should be the same
27
+ Then gem file "features/development.feature" and generated file "features/development.feature" should be the same
22
28
 
23
- Scenario: Installed Cucumber includes a 'rake features' task
24
- Given an existing newgem scaffold [called 'my_project']
25
- And 'install_cucumber' generator is invoked with arguments ''
26
- When task 'rake features' is invoked
27
- Then task 'rake features' is executed successfully
28
- And output does match /\.{6}/
29
+ Scenario: Installed Cucumber includes a "rake features" task
30
+ Given an existing newgem scaffold [called "my_project"]
31
+ And I invoke "install_cucumber" generator with arguments ""
32
+ And I invoke task "rake manifest"
33
+ When I invoke task "rake features"
34
+ Then task "rake features" is executed successfully
35
+ And I should see
36
+ """
37
+ ......
38
+ """
29
39
 
@@ -5,10 +5,10 @@ Feature: RubyGems can have a website to promote and teach
5
5
  So that I can spend time on the tests and code, and not excessive time on maintenance processes
6
6
 
7
7
  Scenario: Deploy project website via local rsync
8
- Given an existing newgem scaffold [called 'my_project']
8
+ Given an existing newgem scaffold [called "my_project"]
9
9
  And project website configuration for safe folder on local machine
10
- When 'install_website' generator is invoked with arguments ''
11
- And task 'rake website' is invoked
12
- Then file 'website/index.html' is created
13
- Then remote file 'index.html' is created after local rsync
14
- Then remote folder 'rdoc' is created after local rsync
10
+ When I invoke "install_website" generator with arguments ""
11
+ And I invoke task "rake website"
12
+ Then file "website/index.html" is created
13
+ Then remote file "index.html" is created after local rsync
14
+ Then remote folder "rdoc" is created after local rsync
@@ -1,4 +1,4 @@
1
- Feature: Can run 'newgem' to create RubyGem scaffolds
1
+ Feature: Can run "newgem" to create RubyGem scaffolds
2
2
 
3
3
  As a developer of RubyGems
4
4
  I want to create RubyGem scaffolds
@@ -6,80 +6,124 @@ Feature: Can run 'newgem' to create RubyGem scaffolds
6
6
 
7
7
  Scenario: Run newgem without any arguments
8
8
  Given a safe folder
9
- Given env variable $RUBYFORGE_USERNAME set to ''
10
- When newgem is executed for project 'my_project' with no options
11
- Then file 'Rakefile' is created
12
- And does invoke generator 'install_test_unit'
13
- And does invoke generator 'install_rubigen_scripts'
14
- And does not invoke generator 'install_website'
15
- And does not invoke generator 'install_rspec'
16
- And does not invoke generator 'install_shoulda'
17
- And does not invoke generator 'install_cucumber'
18
- And file 'config/website.yml' is not created
19
- And output same as contents of 'newgem.out'
9
+ Given env variable $RUBYFORGE_USERNAME set to ""
10
+ When newgem is executed for project "my_project" with no options
11
+ Then file "Rakefile" is created
12
+ And does invoke generator "install_test_unit"
13
+ And does invoke generator "install_rubigen_scripts"
14
+ And does not invoke generator "install_website"
15
+ And does not invoke generator "install_rspec"
16
+ And does not invoke generator "install_shoulda"
17
+ And does not invoke generator "install_cucumber"
18
+ And file "config/website.yml" is not created
19
+ And I should see
20
+ """
21
+ create
22
+ create doc
23
+ create lib
24
+ create script
25
+ create tasks
26
+ create lib/my_project
27
+ create History.txt
28
+ create Rakefile
29
+ create README.rdoc
30
+ create PostInstall.txt
31
+ create lib/my_project.rb
32
+ dependency install_test_unit
33
+ create test
34
+ create test/test_helper.rb
35
+ create test/test_my_project.rb
36
+ dependency install_rubigen_scripts
37
+ exists script
38
+ create script/generate
39
+ create script/destroy
40
+ create script/console
41
+ create Manifest.txt
42
+ readme readme
43
+ Important
44
+ =========
45
+
46
+ * Open Rakefile
47
+ * Update missing details (gem description, dependent gems, etc.)
48
+ """
20
49
  And Rakefile can display tasks successfully
50
+ When I invoke task "rake test"
51
+ Then I should see all 1 tests pass
21
52
 
22
53
  Scenario: Run newgem with project name containing hypens
23
54
  Given a safe folder
24
- Given env variable $RUBYFORGE_USERNAME set to ''
25
- When newgem is executed for project 'my-project' with no options
55
+ Given env variable $RUBYFORGE_USERNAME set to ""
56
+ When newgem is executed for project "my-project" with no options
26
57
  Then Rakefile can display tasks successfully
27
58
 
28
59
  Scenario: Run newgem to include rspec
29
60
  Given a safe folder
30
- When newgem is executed for project 'my_rspec_project' with options '-T rspec'
31
- Then does invoke generator 'install_rspec'
32
- And does not invoke generator 'install_test_unit'
33
- And does not invoke generator 'install_shoulda'
34
- And does not invoke generator 'install_cucumber'
61
+ When newgem is executed for project "my_rspec_project" with options "-T rspec"
62
+ Then does invoke generator "install_rspec"
63
+ And does not invoke generator "install_test_unit"
64
+ And does not invoke generator "install_shoulda"
65
+ And does not invoke generator "install_cucumber"
66
+ And Rakefile can display tasks successfully
67
+ When I invoke task "rake spec"
68
+ Then I should see all 1 examples pass
69
+
70
+ Scenario: Run newgem to include shoulda
71
+ Given a safe folder
72
+ When newgem is executed for project "my_shoulda_project" with options "-T shoulda"
73
+ Then does invoke generator "install_shoulda"
74
+ And does not invoke generator "install_test_unit"
75
+ And does not invoke generator "install_rspec"
76
+ And does not invoke generator "install_cucumber"
35
77
  And Rakefile can display tasks successfully
78
+ When I invoke task "rake test"
79
+ Then I should see all 1 tests pass
36
80
 
37
81
  Scenario: Run newgem to enable website
38
82
  Given a safe folder
39
- When newgem is executed for project 'my_project' with options '-w'
40
- Then does invoke generator 'install_website'
41
- And file 'config/website.yml.sample' is created
42
- And yaml file 'config/website.yml.sample' contains {"host" => "unknown@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
83
+ When newgem is executed for project "my_project" with options "-w"
84
+ Then does invoke generator "install_website"
85
+ And file "config/website.yml.sample" is created
86
+ And yaml file "config/website.yml.sample" contains {"host" => "unknown@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
43
87
  And Rakefile can display tasks successfully
44
88
 
45
89
  Scenario: Run newgem to enable website, with env $RUBYFORGE_USERNAME set
46
90
  Given a safe folder
47
- Given env variable $RUBYFORGE_USERNAME set to 'nicwilliams'
48
- When newgem is executed for project 'my_project' with options '-w'
49
- Then file 'config/website.yml.sample' is created
50
- And yaml file 'config/website.yml.sample' contains {"host" => "nicwilliams@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
91
+ Given env variable $RUBYFORGE_USERNAME set to "nicwilliams"
92
+ When newgem is executed for project "my_project" with options "-w"
93
+ Then file "config/website.yml.sample" is created
94
+ And yaml file "config/website.yml.sample" contains {"host" => "nicwilliams@rubyforge.org", "remote_dir" => "/var/www/gforge-projects/my_project"}
51
95
  And Rakefile can display tasks successfully
52
96
 
53
97
  Scenario: Run newgem to install misc generators on top of unit test framework
54
98
  Given a safe folder
55
- When newgem is executed for project 'my_project' with options '-i cucumber'
56
- Then does invoke generator 'install_test_unit'
57
- And does invoke generator 'install_cucumber'
58
- And does not invoke generator 'install_rspec'
99
+ When newgem is executed for project "my_project" with options "-i cucumber"
100
+ Then does invoke generator "install_test_unit"
101
+ And does invoke generator "install_cucumber"
102
+ And does not invoke generator "install_rspec"
59
103
  And Rakefile can display tasks successfully
60
104
 
61
105
  Scenario: Run newgem to pull in defaults from ~/.newgem.yml file and no argument options
62
106
  Given a safe folder
63
107
  And ~/.newgem.yml contains {"default" => "-T rspec -i cucumber"}
64
- When newgem is executed for project 'my_project' with options ''
65
- Then does invoke generator 'install_rspec'
66
- And does invoke generator 'install_cucumber'
67
- And does not invoke generator 'install_website'
68
- And does not invoke generator 'install_test_unit'
108
+ When newgem is executed for project "my_project" with options ""
109
+ Then does invoke generator "install_rspec"
110
+ And does invoke generator "install_cucumber"
111
+ And does not invoke generator "install_website"
112
+ And does not invoke generator "install_test_unit"
69
113
  And Rakefile can display tasks successfully
70
114
 
71
115
  Scenario: Run newgem to pull in defaults from ~/.newgem.yml file and merge with runtime args
72
116
  Given a safe folder
73
117
  And ~/.newgem.yml contains {"default" => "-T rspec -i cucumber"}
74
- When newgem is executed for project 'my_project' with options '-i website'
75
- Then does invoke generator 'install_rspec'
76
- And does invoke generator 'install_cucumber'
77
- And does invoke generator 'install_website'
78
- And does not invoke generator 'install_test_unit'
118
+ When newgem is executed for project "my_project" with options "-i website"
119
+ Then does invoke generator "install_rspec"
120
+ And does invoke generator "install_cucumber"
121
+ And does invoke generator "install_website"
122
+ And does not invoke generator "install_test_unit"
79
123
  And Rakefile can display tasks successfully
80
124
 
81
125
  Scenario: Run newgem and show current version number
82
126
  Given a safe folder
83
- When newgem is executed only with options '--version'
127
+ When newgem is executed only with options "--version"
84
128
  Then shows version number
85
129