juwelier 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.document +8 -0
  4. data/.semver +5 -0
  5. data/.travis.yml +7 -0
  6. data/.yardopts +2 -0
  7. data/ChangeLog.markdown +230 -0
  8. data/Gemfile +40 -0
  9. data/LICENSE.txt +20 -0
  10. data/README.markdown +252 -0
  11. data/Rakefile +78 -0
  12. data/bin/juwelier +9 -0
  13. data/features/generator/cucumber.feature +103 -0
  14. data/features/generator/directory_layout.feature +86 -0
  15. data/features/generator/dotdocument.feature +13 -0
  16. data/features/generator/env_options.feature +9 -0
  17. data/features/generator/gemfile.feature +81 -0
  18. data/features/generator/git.feature +102 -0
  19. data/features/generator/license.feature +20 -0
  20. data/features/generator/rakefile.feature +158 -0
  21. data/features/generator/readme.feature +12 -0
  22. data/features/generator/test.feature +54 -0
  23. data/features/generator/test_helper.feature +149 -0
  24. data/features/placeholder.feature +5 -0
  25. data/features/step_definitions/debug_steps.rb +6 -0
  26. data/features/step_definitions/filesystem_steps.rb +70 -0
  27. data/features/step_definitions/generator_steps.rb +387 -0
  28. data/features/step_definitions/task_steps.rb +6 -0
  29. data/features/support/env.rb +41 -0
  30. data/features/tasks/build_gem.feature +9 -0
  31. data/features/tasks/version.feature +31 -0
  32. data/features/tasks/version_bumping.feature +49 -0
  33. data/juwelier.gemspec +241 -0
  34. data/lib/juwelier.rb +178 -0
  35. data/lib/juwelier/commands.rb +20 -0
  36. data/lib/juwelier/commands/build_gem.rb +40 -0
  37. data/lib/juwelier/commands/check_dependencies.rb +66 -0
  38. data/lib/juwelier/commands/install_gem.rb +31 -0
  39. data/lib/juwelier/commands/release_gemspec.rb +87 -0
  40. data/lib/juwelier/commands/release_to_git.rb +64 -0
  41. data/lib/juwelier/commands/release_to_rubygems.rb +28 -0
  42. data/lib/juwelier/commands/validate_gemspec.rb +30 -0
  43. data/lib/juwelier/commands/version/base.rb +55 -0
  44. data/lib/juwelier/commands/version/bump_major.rb +13 -0
  45. data/lib/juwelier/commands/version/bump_minor.rb +12 -0
  46. data/lib/juwelier/commands/version/bump_patch.rb +14 -0
  47. data/lib/juwelier/commands/version/write.rb +12 -0
  48. data/lib/juwelier/commands/write_gemspec.rb +39 -0
  49. data/lib/juwelier/errors.rb +8 -0
  50. data/lib/juwelier/gemcutter_tasks.rb +8 -0
  51. data/lib/juwelier/gemspec_helper.rb +87 -0
  52. data/lib/juwelier/generator.rb +304 -0
  53. data/lib/juwelier/generator/application.rb +63 -0
  54. data/lib/juwelier/generator/bacon_mixin.rb +43 -0
  55. data/lib/juwelier/generator/github_mixin.rb +22 -0
  56. data/lib/juwelier/generator/micronaut_mixin.rb +41 -0
  57. data/lib/juwelier/generator/minitest_mixin.rb +42 -0
  58. data/lib/juwelier/generator/options.rb +172 -0
  59. data/lib/juwelier/generator/rdoc_mixin.rb +13 -0
  60. data/lib/juwelier/generator/riot_mixin.rb +42 -0
  61. data/lib/juwelier/generator/rspec_mixin.rb +42 -0
  62. data/lib/juwelier/generator/shindo_mixin.rb +44 -0
  63. data/lib/juwelier/generator/shoulda_mixin.rb +42 -0
  64. data/lib/juwelier/generator/testspec_mixin.rb +42 -0
  65. data/lib/juwelier/generator/testunit_mixin.rb +39 -0
  66. data/lib/juwelier/generator/yard_mixin.rb +15 -0
  67. data/lib/juwelier/rubyforge_tasks.rb +95 -0
  68. data/lib/juwelier/rubygems_dot_org_tasks.rb +38 -0
  69. data/lib/juwelier/rubygems_tasks.rb +38 -0
  70. data/lib/juwelier/specification.rb +110 -0
  71. data/lib/juwelier/tasks.rb +239 -0
  72. data/lib/juwelier/templates/.document +5 -0
  73. data/lib/juwelier/templates/.gitignore +49 -0
  74. data/lib/juwelier/templates/Gemfile +12 -0
  75. data/lib/juwelier/templates/LICENSE.txt +20 -0
  76. data/lib/juwelier/templates/README.rdoc +19 -0
  77. data/lib/juwelier/templates/Rakefile +9 -0
  78. data/lib/juwelier/templates/bacon/flunking.rb +7 -0
  79. data/lib/juwelier/templates/bacon/helper.rb +10 -0
  80. data/lib/juwelier/templates/bundler_setup.erb +10 -0
  81. data/lib/juwelier/templates/features/default.feature +9 -0
  82. data/lib/juwelier/templates/features/support/env.rb +11 -0
  83. data/lib/juwelier/templates/juwelier_tasks.erb +31 -0
  84. data/lib/juwelier/templates/micronaut/flunking.rb +7 -0
  85. data/lib/juwelier/templates/micronaut/helper.rb +19 -0
  86. data/lib/juwelier/templates/minitest/flunking.rb +7 -0
  87. data/lib/juwelier/templates/minitest/helper.rb +13 -0
  88. data/lib/juwelier/templates/other_tasks.erb +70 -0
  89. data/lib/juwelier/templates/riot/flunking.rb +11 -0
  90. data/lib/juwelier/templates/riot/helper.rb +5 -0
  91. data/lib/juwelier/templates/rspec/.rspec +1 -0
  92. data/lib/juwelier/templates/rspec/flunking.rb +7 -0
  93. data/lib/juwelier/templates/rspec/helper.rb +14 -0
  94. data/lib/juwelier/templates/shindo/flunking.rb +8 -0
  95. data/lib/juwelier/templates/shindo/helper.rb +7 -0
  96. data/lib/juwelier/templates/shoulda/flunking.rb +7 -0
  97. data/lib/juwelier/templates/shoulda/helper.rb +12 -0
  98. data/lib/juwelier/templates/simplecov.erb +16 -0
  99. data/lib/juwelier/templates/testspec/flunking.rb +7 -0
  100. data/lib/juwelier/templates/testspec/helper.rb +7 -0
  101. data/lib/juwelier/templates/testunit/flunking.rb +7 -0
  102. data/lib/juwelier/templates/testunit/helper.rb +11 -0
  103. data/lib/juwelier/version.rb +10 -0
  104. data/lib/juwelier/version_helper.rb +141 -0
  105. data/test/fixtures/bar/VERSION.yml +4 -0
  106. data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
  107. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  108. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
  109. data/test/fixtures/existing-project-with-version-constant/.document +5 -0
  110. data/test/fixtures/existing-project-with-version-constant/.gitignore +5 -0
  111. data/test/fixtures/existing-project-with-version-constant/LICENSE.txt +20 -0
  112. data/test/fixtures/existing-project-with-version-constant/README.rdoc +7 -0
  113. data/test/fixtures/existing-project-with-version-constant/Rakefile +85 -0
  114. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +29 -0
  115. data/test/fixtures/existing-project-with-version-constant/lib/existing_project_with_version.rb +0 -0
  116. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +7 -0
  117. data/test/fixtures/existing-project-with-version-constant/test/test_helper.rb +10 -0
  118. data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
  119. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
  120. data/test/fixtures/existing-project-with-version-plaintext/LICENSE.txt +20 -0
  121. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
  122. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +84 -0
  123. data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
  124. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
  125. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  126. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
  127. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
  128. data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
  129. data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
  130. data/test/fixtures/existing-project-with-version-yaml/LICENSE.txt +20 -0
  131. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
  132. data/test/fixtures/existing-project-with-version-yaml/Rakefile +84 -0
  133. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
  134. data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +0 -0
  135. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
  136. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  137. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
  138. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
  139. data/test/geminstaller.yml +12 -0
  140. data/test/juwelier/commands/test_build_gem.rb +112 -0
  141. data/test/juwelier/commands/test_install_gem.rb +35 -0
  142. data/test/juwelier/commands/test_release_to_gemcutter.rb +39 -0
  143. data/test/juwelier/commands/test_release_to_git.rb +271 -0
  144. data/test/juwelier/commands/test_release_to_github.rb +477 -0
  145. data/test/juwelier/commands/test_validate_gemspec.rb +27 -0
  146. data/test/juwelier/commands/test_write_gemspec.rb +103 -0
  147. data/test/juwelier/commands/version/test_base.rb +53 -0
  148. data/test/juwelier/commands/version/test_bump_major.rb +22 -0
  149. data/test/juwelier/commands/version/test_bump_minor.rb +19 -0
  150. data/test/juwelier/commands/version/test_bump_patch.rb +20 -0
  151. data/test/juwelier/commands/version/test_write.rb +22 -0
  152. data/test/juwelier/generator/test_application.rb +142 -0
  153. data/test/juwelier/generator/test_options.rb +227 -0
  154. data/test/juwelier/test_gemspec_helper.rb +44 -0
  155. data/test/juwelier/test_generator.rb +140 -0
  156. data/test/juwelier/test_generator_initialization.rb +150 -0
  157. data/test/juwelier/test_generator_mixins.rb +23 -0
  158. data/test/juwelier/test_specification.rb +245 -0
  159. data/test/juwelier/test_tasks.rb +50 -0
  160. data/test/juwelier/test_version_helper.rb +214 -0
  161. data/test/shoulda_macros/juwelier_macros.rb +35 -0
  162. data/test/test_helper.rb +174 -0
  163. data/test/test_juwelier.rb +177 -0
  164. metadata +396 -0
@@ -0,0 +1,20 @@
1
+ Feature: generated license
2
+ In order to start a new gem
3
+ A user should be able to
4
+ generate a default license
5
+
6
+ Background:
7
+ Given a working directory
8
+
9
+ Scenario: crediting user
10
+ Given I have configured git sanely
11
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
12
+
13
+ Then LICENSE.txt credits 'foo'
14
+
15
+ Scenario: copyright in the current year
16
+ Given it is the year 2005
17
+ And I have configured git sanely
18
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
19
+
20
+ Then LICENSE.txt has a copyright in the year 2005
@@ -0,0 +1,158 @@
1
+ Feature: generated Rakefile
2
+ In order to start a new gem
3
+ A user should be able to
4
+ generate a Rakefile
5
+
6
+ Background:
7
+ Given a working directory
8
+ And I have configured git sanely
9
+
10
+ Scenario: shared
11
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good' and described as 'Descriptive'
12
+
13
+ Then 'Rakefile' requires 'bundler'
14
+ And 'Rakefile' sets up bundler using the default and development groups
15
+ And 'Rakefile' requires 'rubygems'
16
+ And 'Rakefile' requires 'rake'
17
+ And 'Rakefile' requires 'rdoc/task'
18
+ And Rakefile has 'the-perfect-gem' for the Juwelier::Tasks name
19
+ And Rakefile has 'bar@example.com' for the Juwelier::Tasks email
20
+ And Rakefile has 'zomg, so good' for the Juwelier::Tasks summary
21
+ And Rakefile has 'Descriptive' for the Juwelier::Tasks description
22
+ And Rakefile has 'http://github.com/flajann2/the-perfect-gem' for the Juwelier::Tasks homepage
23
+ And Rakefile has 'MIT' for the Juwelier::Tasks license
24
+ And Rakefile instantiates a Juwelier::RubygemsDotOrgTasks
25
+ And Rakefile has a magic comment for UTF-8
26
+
27
+ Scenario: bacon
28
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
29
+ Then 'Rakefile' requires 'rcov/rcovtask'
30
+ And Rakefile has 'spec/**/*_spec.rb' for the Rake::TestTask pattern
31
+ And Rakefile has 'spec/**/*_spec.rb' for the Rcov::RcovTask pattern
32
+ And Rakefile has 'spec' in the Rcov::RcovTask libs
33
+ And Rakefile has "spec" as the default task
34
+
35
+ Scenario: minitest
36
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
37
+
38
+ Then 'Rakefile' requires 'rcov/rcovtask'
39
+ And Rakefile has 'test/**/test_*.rb' for the Rake::TestTask pattern
40
+ And Rakefile has 'test/**/test_*.rb' for the Rcov::RcovTask pattern
41
+ And Rakefile has 'test' in the Rcov::RcovTask libs
42
+ And Rakefile has "test" as the default task
43
+
44
+ @rspec
45
+ Scenario: rspec
46
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
47
+
48
+ Then 'Rakefile' requires 'rspec/core'
49
+ And 'Rakefile' requires 'rspec/core/rake_task'
50
+ And Rakefile has 'spec/**/*_spec.rb' for the RSpec::Core::RakeTask pattern
51
+ And Rakefile has "spec" as the default task
52
+
53
+ Scenario: shoulda
54
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
55
+
56
+ Then 'Rakefile' requires 'rcov/rcovtask'
57
+ And Rakefile has 'test/**/test_*.rb' for the Rake::TestTask pattern
58
+ And Rakefile has 'test/**/test_*.rb' for the Rcov::RcovTask pattern
59
+ And Rakefile has 'test' in the Rcov::RcovTask libs
60
+ And Rakefile has "test" as the default task
61
+
62
+ Scenario: micronaut
63
+ When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
64
+
65
+ Then 'Rakefile' requires 'micronaut/rake_task'
66
+ And Rakefile has 'examples/**/*_example.rb' for the Micronaut::RakeTask pattern
67
+ And Rakefile has "examples" as the default task
68
+
69
+ Scenario: testunit
70
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
71
+
72
+ Then 'Rakefile' requires 'rcov/rcovtask'
73
+ Then Rakefile has 'test/**/test_*.rb' for the Rake::TestTask pattern
74
+ And Rakefile has 'test/**/test_*.rb' for the Rcov::RcovTask pattern
75
+ And Rakefile has 'test' in the Rcov::RcovTask libs
76
+ And Rakefile has '--exclude "gems/*"' in the Rcov::RcovTask rcov_opts
77
+ And Rakefile has "test" as the default task
78
+
79
+ Scenario: no cucumber
80
+ Given I do not want cucumber stories
81
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
82
+ Then Rakefile does not require 'cucumber/rake/task'
83
+ And Rakefile does not instantiate a Cucumber::Rake::Task
84
+
85
+ Scenario: cucumber
86
+ Given I want cucumber stories
87
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
88
+ Then Rakefile requires 'cucumber/rake/task'
89
+ And Rakefile instantiates a Cucumber::Rake::Task
90
+
91
+ Scenario: no reek
92
+ Given I do not want reek
93
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
94
+ Then Rakefile does not require 'reek/rake/task'
95
+ And Rakefile does not instantiate a Reek::Rake::Task
96
+
97
+ Scenario: reek
98
+ Given I want reek
99
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
100
+ Then Rakefile requires 'reek/rake/task'
101
+ And Rakefile instantiates a Reek::Rake::Task
102
+
103
+ Scenario: no roodi
104
+ Given I do not want roodi
105
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
106
+ Then Rakefile does not require 'roodi'
107
+ And Rakefile does not require 'roodi_task'
108
+ And Rakefile does not instantiate a RoodiTask
109
+
110
+ Scenario: roodi
111
+ Given I want roodi
112
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
113
+ Then Rakefile requires 'roodi'
114
+ And Rakefile requires 'roodi_task'
115
+ And Rakefile instantiates a RoodiTask
116
+
117
+ Scenario: no rubyforge
118
+ Given I do not want rubyforge setup
119
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
120
+ Then Rakefile does not instantiate a Juwelier::RubyforgeTasks
121
+
122
+ Scenario: yard
123
+ Given I want to use yard instead of rdoc
124
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
125
+
126
+ Then 'Rakefile' does not require 'rdoc/task'
127
+ And 'Rakefile' requires 'yard'
128
+ And Rakefile instantiates a YARD::Rake::YardocTask
129
+
130
+ Scenario: rdoc
131
+ Given I want to use rdoc instead of yard
132
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
133
+
134
+ Then 'Rakefile' does not require 'yard'
135
+ And 'Rakefile' requires 'rdoc/task'
136
+ And Rakefile does not instantiate a YARD::Rake::YardocTask
137
+ And Rakefile instantiates a Rake::RDocTask.new
138
+
139
+ Scenario: shindo
140
+ When I generate a shindo project named 'the-perfect-gem' that is 'zomg, so good'
141
+ And 'Rakefile' requires 'shindo/rake'
142
+ And Rakefile instantiates a Shindo::Rake.new
143
+ And Rakefile has "tests" as the default task
144
+
145
+
146
+ Scenario: bundler
147
+ Given I want bundler
148
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good' and described as 'Descriptive'
149
+ Then 'Rakefile' requires 'bundler'
150
+ And 'Rakefile' sets up bundler using the default and development groups
151
+ And Rakefile does not add 'juwelier' as a development dependency to Juwelier::Tasks
152
+
153
+ Scenario: no bundler
154
+ Given I do not want bundler
155
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good' and described as 'Descriptive'
156
+ Then 'Rakefile' does not require 'bundler'
157
+ And 'Rakefile' does not setup bundler
158
+ And Rakefile adds 'juwelier' as a development dependency to Juwelier::Tasks
@@ -0,0 +1,12 @@
1
+ Feature: generated license
2
+ In order to start a new gem
3
+ A user should be able to
4
+ generate a default license
5
+
6
+ Scenario: copyright
7
+ Given a working directory
8
+ And I have configured git sanely
9
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
10
+
11
+ Then 'README.rdoc' contains '= the-perfect-gem'
12
+ And 'README.rdoc' mentions copyright belonging to me in the current year
@@ -0,0 +1,54 @@
1
+ Feature: generated test or spec
2
+ In order to start a new gem
3
+ A user should be able to
4
+ generate a test or spec
5
+
6
+ Scenario: bacon
7
+ Given a working directory
8
+ And I have configured git sanely
9
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
10
+ Then 'spec/the-perfect-gem_spec.rb' should describe 'ThePerfectGem'
11
+
12
+ Scenario: minitest
13
+ Given a working directory
14
+ And I have configured git sanely
15
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
16
+ Then 'test/test_the-perfect-gem.rb' should define 'TestThePerfectGem' as a subclass of 'MiniTest::Unit::TestCase'
17
+
18
+ Scenario: rspec
19
+ Given a working directory
20
+ And I have configured git sanely
21
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
22
+ Then 'spec/the-perfect-gem_spec.rb' should describe 'ThePerfectGem'
23
+
24
+ Scenario: shoulda
25
+ Given a working directory
26
+ And I have configured git sanely
27
+ And I intend to test with shoulda
28
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
29
+ Then 'test/test_the-perfect-gem.rb' should define 'TestThePerfectGem' as a subclass of 'Test::Unit::TestCase'
30
+
31
+ Scenario: testunit
32
+ Given a working directory
33
+ And I have configured git sanely
34
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
35
+ Then 'test/test_the-perfect-gem.rb' should define 'TestThePerfectGem' as a subclass of 'Test::Unit::TestCase'
36
+
37
+ Scenario: micronaut
38
+ Given a working directory
39
+ And I have configured git sanely
40
+ When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
41
+ Then 'examples/the-perfect-gem_example.rb' should describe 'ThePerfectGem'
42
+
43
+ Scenario: riot
44
+ Given a working directory
45
+ And I have configured git sanely
46
+ When I generate a riot project named 'the-perfect-gem' that is 'zomg, so good'
47
+ Then 'test/the-perfect-gem_test.rb' should contextualize 'the-perfect-gem'
48
+ And 'test/the-perfect-gem_test.rb' requires 'teststrap'
49
+
50
+ Scenario: shindo
51
+ Given a working directory
52
+ And I have configured git sanely
53
+ When I generate a shindo project named 'the-perfect-gem' that is 'zomg, so good'
54
+ Then 'tests/the-perfect-gem_tests.rb' should have tests for 'ThePerfectGem'
@@ -0,0 +1,149 @@
1
+ Feature: generated test or spec
2
+ In order to start a new gem
3
+ A user should be able to
4
+ generate a test or spec
5
+
6
+ Scenario: bacon w/ bundler
7
+ Given a working directory
8
+ And I have configured git sanely
9
+ And I want bundler
10
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
11
+ Then 'spec/spec_helper.rb' requires 'bundler'
12
+ And 'spec/spec_helper.rb' sets up bundler using the default and development groups
13
+ And 'spec/spec_helper.rb' requires 'bacon'
14
+ And 'spec/spec_helper.rb' requires 'the-perfect-gem'
15
+
16
+ Scenario: bacon w/o bundler
17
+ Given a working directory
18
+ And I have configured git sanely
19
+ And I do not want bundler
20
+ When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
21
+ Then 'spec/spec_helper.rb' does not require 'bundler'
22
+ And 'spec/spec_helper.rb' does not setup bundler
23
+
24
+ Scenario: minitest w/ bundler
25
+ Given a working directory
26
+ And I have configured git sanely
27
+ And I want bundler
28
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
29
+ Then 'test/helper.rb' requires 'bundler'
30
+ And 'test/helper.rb' sets up bundler using the default and development groups
31
+ And 'test/helper.rb' requires 'minitest/unit'
32
+ And 'test/helper.rb' requires 'the-perfect-gem'
33
+ And 'test/helper.rb' should autorun tests
34
+
35
+ Scenario: minitest w/o bundler
36
+ Given a working directory
37
+ And I have configured git sanely
38
+ And I do not want bundler
39
+ When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
40
+ Then 'test/helper.rb' does not require 'bundler'
41
+ And 'test/helper.rb' does not setup bundler
42
+
43
+ Scenario: rspec w/ bundler
44
+ Given a working directory
45
+ And I have configured git sanely
46
+ And I want bundler
47
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
48
+ Then 'spec/spec_helper.rb' requires 'rspec'
49
+ And 'spec/spec_helper.rb' requires 'the-perfect-gem'
50
+
51
+ Scenario: rspec w/o bundler
52
+ Given a working directory
53
+ And I have configured git sanely
54
+ And I do not want bundler
55
+ When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
56
+ Then 'spec/spec_helper.rb' does not require 'bundler'
57
+ And 'spec/spec_helper.rb' does not setup bundler
58
+
59
+ Scenario: shoulda w/ bundler
60
+ Given a working directory
61
+ And I have configured git sanely
62
+ And I want bundler
63
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
64
+ Then 'test/helper.rb' requires 'bundler'
65
+ And 'test/helper.rb' sets up bundler using the default and development groups
66
+ And 'test/helper.rb' requires 'test/unit'
67
+ And 'test/helper.rb' requires 'shoulda'
68
+ And 'test/helper.rb' requires 'the-perfect-gem'
69
+
70
+ Scenario: shoulda w/o bundler
71
+ Given a working directory
72
+ And I have configured git sanely
73
+ And I do not want bundler
74
+ When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
75
+ And 'test/helper.rb' does not require 'bundler'
76
+ And 'test/helper.rb' does not setup bundler
77
+
78
+ Scenario: testunit w/ bundler
79
+ Given a working directory
80
+ And I have configured git sanely
81
+ And I want bundler
82
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
83
+ Then 'test/helper.rb' requires 'test/unit'
84
+ And 'test/helper.rb' requires 'the-perfect-gem'
85
+ And 'test/helper.rb' requires 'bundler'
86
+ And 'test/helper.rb' sets up bundler using the default and development groups
87
+
88
+ Scenario: testunit w/o bundler
89
+ Given a working directory
90
+ And I have configured git sanely
91
+ And I do not want bundler
92
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
93
+ And 'test/helper.rb' does not require 'bundler'
94
+ And 'test/helper.rb' does not setup bundler
95
+
96
+ Scenario: micronaut w/ bundler
97
+ Given a working directory
98
+ And I have configured git sanely
99
+ And I want bundler
100
+ When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
101
+ Then 'examples/example_helper.rb' requires 'rubygems'
102
+ Then 'examples/example_helper.rb' requires 'micronaut'
103
+ Then 'examples/example_helper.rb' requires 'the-perfect-gem'
104
+ And 'examples/example_helper.rb' requires 'bundler'
105
+ And 'examples/example_helper.rb' sets up bundler using the default and development groups
106
+
107
+ Scenario: micronaut w/o bundler
108
+ Given a working directory
109
+ And I have configured git sanely
110
+ And I do not want bundler
111
+ When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
112
+ And 'examples/example_helper.rb' does not require 'bundler'
113
+ And 'examples/example_helper.rb' does not setup bundler
114
+
115
+ Scenario: riot w/ bundler
116
+ Given a working directory
117
+ And I have configured git sanely
118
+ And I want bundler
119
+ When I generate a riot project named 'the-perfect-gem' that is 'zomg, so good'
120
+ Then 'test/teststrap.rb' requires 'riot'
121
+ And 'test/teststrap.rb' requires 'the-perfect-gem'
122
+ And 'test/teststrap.rb' requires 'bundler'
123
+ And 'test/teststrap.rb' sets up bundler using the default and development groups
124
+
125
+ Scenario: riot w/o bundler
126
+ Given a working directory
127
+ And I have configured git sanely
128
+ And I do not want bundler
129
+ When I generate a riot project named 'the-perfect-gem' that is 'zomg, so good'
130
+ And 'test/teststrap.rb' does not require 'bundler'
131
+ And 'test/teststrap.rb' does not setup bundler
132
+
133
+ Scenario: shindo w/ bundler
134
+ Given a working directory
135
+ And I have configured git sanely
136
+ And I want bundler
137
+ When I generate a shindo project named 'the-perfect-gem' that is 'zomg, so good'
138
+ Then 'tests/tests_helper.rb' requires 'the-perfect-gem'
139
+ Then 'tests/tests_helper.rb' requires 'shindo'
140
+ Then 'tests/tests_helper.rb' requires 'bundler'
141
+ And 'tests/tests_helper.rb' sets up bundler using the default and development groups
142
+
143
+ Scenario: shindo w/o bundler
144
+ Given a working directory
145
+ And I have configured git sanely
146
+ And I do not want bundler
147
+ When I generate a shindo project named 'the-perfect-gem' that is 'zomg, so good'
148
+ Then 'tests/tests_helper.rb' does not require 'bundler'
149
+ And 'tests/tests_helper.rb' does not setup bundler
@@ -0,0 +1,5 @@
1
+ Feature: I am a placeholder
2
+
3
+ Scenario: I am also a placeholder
4
+ Given a working directory
5
+
@@ -0,0 +1,6 @@
1
+ Then /^I debug$/ do
2
+ require 'ruby-debug'
3
+ breakpoint
4
+ 0
5
+ end
6
+
@@ -0,0 +1,70 @@
1
+ Given 'a working directory' do
2
+ @working_dir = create_construct
3
+ end
4
+
5
+ After do
6
+ @working_dir.destroy! if @working_dir
7
+ end
8
+
9
+ Given /^I use the juwelier command to generate the "([^"]+)" project in the working directory$/ do |name|
10
+ @name = name
11
+
12
+ return_to = Dir.pwd
13
+ path_to_juwelier = File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'bin', 'juwelier')
14
+
15
+ begin
16
+ FileUtils.cd @working_dir
17
+ @stdout = `#{path_to_juwelier} #{@name}`
18
+ ensure
19
+ FileUtils.cd return_to
20
+ end
21
+ end
22
+
23
+ Given /^"([^"]+)" does not exist$/ do |file|
24
+ assert ! File.exists?(File.join(@working_dir, file))
25
+ end
26
+
27
+ When /^I run "([^"]+)" in "([^"]+)"$/ do |command, directory|
28
+ full_path = File.join(@working_dir, directory)
29
+
30
+ lib_path = File.expand_path 'lib'
31
+ command.gsub!(/^rake /, "rake --trace -I#{lib_path} ")
32
+
33
+ assert File.directory?(full_path), "#{full_path} is not a directory"
34
+
35
+ @stdout = `cd #{full_path} && #{command}`
36
+ @exited_cleanly = $?.exited?
37
+ end
38
+
39
+ Then /^the updated version, (.*), is displayed$/ do |version|
40
+ assert_match "Updated version: #{version}", @stdout
41
+ end
42
+
43
+ Then /^the current version, (\d+\.\d+\.\d+), is displayed$/ do |version|
44
+ assert_match "Current version: #{version}", @stdout
45
+ end
46
+
47
+ Then /^the process should exit cleanly$/ do
48
+ assert @exited_cleanly, "Process did not exit cleanly: #{@stdout}"
49
+ end
50
+
51
+ Then /^the process should not exit cleanly$/ do
52
+ assert !@exited_cleanly, "Process did exit cleanly: #{@stdout}"
53
+ end
54
+
55
+ Given /^I use the existing project "([^"]+)" as a template$/ do |fixture_project|
56
+ @name = fixture_project
57
+ FileUtils.cp_r File.join(fixture_dir, fixture_project), @working_dir
58
+ end
59
+
60
+ Given /^"VERSION\.yml" contains hash "([^"]+)"$/ do |ruby_string|
61
+ version_hash = YAML.load(File.read(File.join(@working_dir, @name, 'VERSION.yml')))
62
+ evaled_hash = eval(ruby_string)
63
+ assert_equal evaled_hash, version_hash
64
+ end
65
+
66
+ Given /^"VERSION" contains "([^\"]*)"$/ do |expected|
67
+ version = File.read(File.join(@working_dir, @name, 'VERSION')).chomp
68
+ assert_equal expected, version
69
+ end
70
+