technicalpickles-jeweler 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/ChangeLog.markdown +8 -0
- data/README.markdown +9 -9
- data/ROADMAP +12 -0
- data/Rakefile +22 -5
- data/VERSION.yml +2 -2
- data/features/generator/cucumber.feature +83 -0
- data/features/generator/directory_layout.feature +76 -0
- data/features/generator/dotdocument.feature +14 -0
- data/features/generator/env_options.feature +9 -0
- data/features/generator/git.feature +94 -0
- data/features/generator/license.feature +11 -0
- data/features/generator/rakefile.feature +110 -0
- data/features/generator/readme.feature +12 -0
- data/features/generator/test.feature +41 -0
- data/features/generator/test_helper.feature +49 -0
- data/features/placeholder.feature +5 -0
- data/features/step_definitions/debug_steps.rb +6 -0
- data/features/step_definitions/filesystem_steps.rb +65 -0
- data/features/step_definitions/generator_steps.rb +251 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +19 -0
- data/features/tasks/build_gem.feature +9 -0
- data/features/tasks/version.feature +24 -0
- data/features/tasks/version_bumping.feature +33 -0
- data/jeweler.gemspec +204 -0
- data/lib/jeweler/commands/release.rb +35 -11
- data/lib/jeweler/commands/version/base.rb +1 -1
- data/lib/jeweler/gemspec_helper.rb +4 -6
- data/lib/jeweler/generator/application.rb +8 -3
- data/lib/jeweler/generator/bacon_mixin.rb +39 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +38 -0
- data/lib/jeweler/generator/minitest_mixin.rb +39 -0
- data/lib/jeweler/generator/options.rb +5 -1
- data/lib/jeweler/generator/rspec_mixin.rb +39 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +39 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/generator.rb +48 -111
- data/lib/jeweler/rubyforge_tasks.rb +46 -0
- data/lib/jeweler/specification.rb +3 -2
- data/lib/jeweler/tasks.rb +32 -26
- data/lib/jeweler/templates/README.rdoc +1 -1
- data/lib/jeweler/templates/Rakefile +29 -52
- data/lib/jeweler/templates/bacon/helper.rb +1 -1
- data/lib/jeweler/templates/features/support/env.rb +4 -7
- data/lib/jeweler/templates/micronaut/helper.rb +1 -1
- data/lib/jeweler/templates/minitest/helper.rb +1 -1
- data/lib/jeweler/templates/rspec/flunking.rb +1 -1
- data/lib/jeweler/templates/rspec/helper.rb +1 -1
- data/lib/jeweler/templates/shoulda/helper.rb +1 -1
- data/lib/jeweler/templates/testunit/helper.rb +1 -1
- data/lib/jeweler/version_helper.rb +78 -33
- data/lib/jeweler.rb +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/LICENSE +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/README.rdoc +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/Rakefile +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/existing-project-with-version.gemspec +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/test/existing_project_with_version_test.rb +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/test/test_helper.rb +0 -0
- data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
- data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
- data/test/fixtures/existing-project-with-version-yaml/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-yaml/Rakefile +82 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-yaml}/VERSION.yml +0 -0
- data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
- data/test/jeweler/commands/test_release.rb +304 -79
- data/test/test_application.rb +26 -0
- data/test/test_gemspec_helper.rb +4 -0
- data/test/test_generator.rb +83 -112
- data/test/test_generator_initialization.rb +113 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +3 -0
- data/test/test_options.rb +6 -0
- data/test/test_specification.rb +6 -2
- data/test/test_version_helper.rb +47 -9
- metadata +72 -17
- data/test/generators/initialization_test.rb +0 -146
@@ -1,146 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class JewelerGeneratorInitializerTest < Test::Unit::TestCase
|
4
|
-
context "given a nil github repo name" do
|
5
|
-
setup do
|
6
|
-
@block = lambda { Jeweler::Generator.new(nil) }
|
7
|
-
end
|
8
|
-
|
9
|
-
should "raise an error" do
|
10
|
-
assert_raise Jeweler::NoGitHubRepoNameGiven do
|
11
|
-
@block.call
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
context "without git user's name set" do
|
17
|
-
setup do
|
18
|
-
Jeweler::Generator.any_instance.stubs(:read_git_config).returns({'user.email' => 'bar@example.com'})
|
19
|
-
end
|
20
|
-
|
21
|
-
context "instantiating new generator" do
|
22
|
-
setup do
|
23
|
-
@block = lambda { Jeweler::Generator.new('the-perfect-gem')}
|
24
|
-
end
|
25
|
-
|
26
|
-
should "raise no git user name exception" do
|
27
|
-
assert_raise Jeweler::NoGitUserName do
|
28
|
-
@block.call
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "without git user's email set" do
|
35
|
-
setup do
|
36
|
-
Jeweler::Generator.any_instance.stubs(:read_git_config).returns({'user.name' => 'foo'})
|
37
|
-
end
|
38
|
-
|
39
|
-
context "instantiating new generator" do
|
40
|
-
setup do
|
41
|
-
@block = lambda { Jeweler::Generator.new('the-perfect-gem')}
|
42
|
-
end
|
43
|
-
|
44
|
-
should "raise no git user name exception" do
|
45
|
-
assert_raise Jeweler::NoGitUserEmail do
|
46
|
-
@block.call
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
context "without github username set" do
|
53
|
-
setup do
|
54
|
-
Jeweler::Generator.any_instance.stubs(:read_git_config).
|
55
|
-
returns({'user.email' => 'bar@example.com', 'user.name' => 'foo'})
|
56
|
-
end
|
57
|
-
|
58
|
-
context "instantiating new generator" do
|
59
|
-
setup do
|
60
|
-
@block = lambda { Jeweler::Generator.new('the-perfect-gem')}
|
61
|
-
end
|
62
|
-
|
63
|
-
should "raise no github user exception" do
|
64
|
-
assert_raise Jeweler::NoGitHubUser do
|
65
|
-
@block.call
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
context "without github token set" do
|
72
|
-
setup do
|
73
|
-
Jeweler::Generator.any_instance.stubs(:read_git_config).
|
74
|
-
returns({'user.email' => 'bar@example.com', 'user.name' => 'foo', 'github.user' => 'technicalpickles'})
|
75
|
-
end
|
76
|
-
|
77
|
-
context "instantiating new generator" do
|
78
|
-
setup do
|
79
|
-
@block = lambda { Jeweler::Generator.new('the-perfect-gem')}
|
80
|
-
end
|
81
|
-
|
82
|
-
should "raise no github user exception" do
|
83
|
-
assert_raise Jeweler::NoGitHubToken do
|
84
|
-
@block.call
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
context "with valid git user configuration" do
|
91
|
-
setup do
|
92
|
-
Jeweler::Generator.any_instance.stubs(:read_git_config).
|
93
|
-
returns({'user.name' => 'foo', 'user.email' => 'bar@example.com', 'github.user' => 'technicalpickles', 'github.token' => 'zomgtoken'})
|
94
|
-
end
|
95
|
-
|
96
|
-
context "for technicalpickle's the-perfect-gem repository" do
|
97
|
-
setup do
|
98
|
-
@generator = Jeweler::Generator.new('the-perfect-gem')
|
99
|
-
end
|
100
|
-
|
101
|
-
should "assign 'foo' to user's name" do
|
102
|
-
assert_equal 'foo', @generator.user_name
|
103
|
-
end
|
104
|
-
|
105
|
-
should "assign 'bar@example.com to user's email" do
|
106
|
-
assert_equal 'bar@example.com', @generator.user_email
|
107
|
-
end
|
108
|
-
|
109
|
-
should "assign github remote" do
|
110
|
-
assert_equal 'git@github.com:technicalpickles/the-perfect-gem.git', @generator.github_remote
|
111
|
-
end
|
112
|
-
|
113
|
-
should "determine github username as technicalpickles" do
|
114
|
-
assert_equal 'technicalpickles', @generator.github_username
|
115
|
-
end
|
116
|
-
|
117
|
-
should "determine github repository name as the-perfect-gem" do
|
118
|
-
assert_equal 'the-perfect-gem', @generator.github_repo_name
|
119
|
-
end
|
120
|
-
|
121
|
-
should "determine github url as http://github.com/technicalpickles/the-perfect-gem" do
|
122
|
-
assert_equal 'http://github.com/technicalpickles/the-perfect-gem', @generator.github_url
|
123
|
-
end
|
124
|
-
|
125
|
-
should "determine target directory as the same as the github repository name" do
|
126
|
-
assert_equal @generator.github_repo_name, @generator.target_dir
|
127
|
-
end
|
128
|
-
|
129
|
-
should "determine lib directory as being inside the target directory" do
|
130
|
-
assert_equal File.join(@generator.target_dir, 'lib'), @generator.lib_dir
|
131
|
-
end
|
132
|
-
|
133
|
-
should "determine test directory as being inside the target directory" do
|
134
|
-
assert_equal File.join(@generator.target_dir, 'test'), @generator.test_dir
|
135
|
-
end
|
136
|
-
|
137
|
-
should "determine constant name as ThePerfectGem" do
|
138
|
-
assert_equal 'ThePerfectGem', @generator.constant_name
|
139
|
-
end
|
140
|
-
|
141
|
-
should "determine file name prefix as the_perfect_gem" do
|
142
|
-
assert_equal 'the_perfect_gem', @generator.file_name_prefix
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|