dima-jeweler 0.9.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/ChangeLog.markdown +54 -1
- data/README.markdown +89 -20
- data/ROADMAP +12 -0
- data/Rakefile +52 -12
- data/VERSION.yml +3 -3
- 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 +151 -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 +68 -0
- data/features/step_definitions/generator_steps.rb +284 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +29 -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 +225 -0
- data/lib/jeweler.rb +39 -52
- data/lib/jeweler/commands.rb +2 -0
- data/lib/jeweler/commands/build_gem.rb +9 -0
- data/lib/jeweler/commands/check_dependencies.rb +52 -0
- data/lib/jeweler/commands/install_gem.rb +23 -2
- data/lib/jeweler/commands/release.rb +52 -12
- data/lib/jeweler/commands/release_to_rubyforge.rb +32 -9
- data/lib/jeweler/commands/setup_rubyforge.rb +57 -0
- data/lib/jeweler/commands/validate_gemspec.rb +9 -0
- data/lib/jeweler/commands/version/base.rb +13 -2
- data/lib/jeweler/commands/write_gemspec.rb +13 -0
- data/lib/jeweler/errors.rb +13 -1
- data/lib/jeweler/gemspec_helper.rb +31 -3
- data/lib/jeweler/generator.rb +80 -120
- data/lib/jeweler/generator/application.rb +12 -3
- data/lib/jeweler/generator/bacon_mixin.rb +43 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +41 -0
- data/lib/jeweler/generator/minitest_mixin.rb +42 -0
- data/lib/jeweler/generator/options.rb +37 -3
- data/lib/jeweler/generator/rdoc_mixin.rb +9 -0
- data/lib/jeweler/generator/rspec_mixin.rb +42 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +42 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/generator/yard_mixin.rb +14 -0
- data/lib/jeweler/rubyforge_tasks.rb +98 -0
- data/lib/jeweler/specification.rb +66 -0
- data/lib/jeweler/tasks.rb +72 -39
- data/lib/jeweler/templates/.document +5 -0
- data/lib/jeweler/templates/README.rdoc +12 -1
- data/lib/jeweler/templates/Rakefile +83 -49
- 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 +4 -3
- 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/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
- data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
- data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -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-plaintext/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -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-yaml/VERSION.yml +4 -0
- data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +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_build_gem.rb +20 -1
- data/test/jeweler/commands/test_install_gem.rb +74 -0
- data/test/jeweler/commands/test_release.rb +289 -77
- data/test/jeweler/commands/test_release_to_rubyforge.rb +66 -50
- data/test/jeweler/commands/test_setup_rubyforge.rb +182 -0
- data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
- data/test/jeweler/commands/test_write_gemspec.rb +34 -0
- data/test/jeweler/commands/version/test_base.rb +32 -0
- data/test/jeweler/commands/version/test_bump_major.rb +1 -0
- data/test/test_application.rb +31 -1
- data/test/test_gemspec_helper.rb +4 -0
- data/test/test_generator.rb +101 -114
- data/test/test_generator_initialization.rb +156 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +104 -16
- data/test/test_jeweler.rb +134 -96
- data/test/test_options.rb +59 -0
- data/test/test_specification.rb +61 -0
- data/test/test_tasks.rb +13 -18
- data/test/test_version_helper.rb +47 -9
- metadata +174 -43
- data/TODO +0 -11
- data/test/generators/initialization_test.rb +0 -146
@@ -1,43 +1,27 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class RubyForgeStub
|
4
|
-
attr_accessor :userconfig
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
@userconfig = {}
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
3
|
class Jeweler
|
12
4
|
module Commands
|
13
5
|
class TestReleaseToRubyforge < Test::Unit::TestCase
|
6
|
+
def self.subject
|
7
|
+
Jeweler::Commands::ReleaseToRubyforge.new
|
8
|
+
end
|
14
9
|
|
15
|
-
|
10
|
+
rubyforge_command_context "rubyforge_project is defined in gemspec and package exists on rubyforge" do
|
16
11
|
setup do
|
17
|
-
@rubyforge = RubyForgeStub.new
|
18
12
|
stub(@rubyforge).configure
|
19
13
|
stub(@rubyforge).login
|
20
14
|
stub(@rubyforge).add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem")
|
21
15
|
|
22
|
-
@gempsec = Object.new
|
23
16
|
stub(@gemspec).description {"The zomg gem rocks."}
|
24
17
|
stub(@gemspec).rubyforge_project {"MyRubyForgeProjectName"}
|
25
18
|
stub(@gemspec).name {"zomg"}
|
26
19
|
|
27
|
-
@gemspec_helper = Object.new
|
28
20
|
stub(@gemspec_helper).write
|
29
21
|
stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
|
30
22
|
stub(@gemspec_helper).update_version('1.2.3')
|
31
23
|
|
32
|
-
@output = StringIO.new
|
33
|
-
|
34
|
-
@command = Jeweler::Commands::ReleaseToRubyforge.new
|
35
|
-
@command.output = @output
|
36
|
-
@command.repo = @repo
|
37
|
-
@command.gemspec = @gemspec
|
38
|
-
@command.gemspec_helper = @gemspec_helper
|
39
24
|
@command.version = '1.2.3'
|
40
|
-
@command.ruby_forge = @rubyforge
|
41
25
|
|
42
26
|
@command.run
|
43
27
|
end
|
@@ -49,7 +33,7 @@ class Jeweler
|
|
49
33
|
should "login" do
|
50
34
|
assert_received(@rubyforge) {|rubyforge| rubyforge.login }
|
51
35
|
end
|
52
|
-
|
36
|
+
|
53
37
|
should "set release notes" do
|
54
38
|
assert_equal "The zomg gem rocks.", @rubyforge.userconfig["release_notes"]
|
55
39
|
end
|
@@ -61,80 +45,112 @@ class Jeweler
|
|
61
45
|
should "add release" do
|
62
46
|
assert_received(@rubyforge) {|rubyforge| rubyforge.add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") }
|
63
47
|
end
|
64
|
-
|
48
|
+
end
|
49
|
+
|
50
|
+
rubyforge_command_context "rubyforge_project is defined in gemspec and package does not exist on rubyforge" do
|
51
|
+
setup do
|
52
|
+
stub(@rubyforge).configure
|
53
|
+
stub(@rubyforge).login
|
54
|
+
stub(@rubyforge).scrape_config
|
55
|
+
stub(@rubyforge).add_release("MyRubyForgeProjectName", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") {
|
56
|
+
raise "no <package_id> configured for <zomg>"
|
57
|
+
}
|
58
|
+
|
59
|
+
stub(@gemspec).description {"The zomg gem rocks."}
|
60
|
+
stub(@gemspec).rubyforge_project {"MyRubyForgeProjectName"}
|
61
|
+
stub(@gemspec).name {"zomg"}
|
62
|
+
|
63
|
+
stub(@gemspec_helper).write
|
64
|
+
stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
|
65
|
+
stub(@gemspec_helper).update_version('1.2.3')
|
66
|
+
|
67
|
+
@command.version = '1.2.3'
|
68
|
+
end
|
69
|
+
|
70
|
+
should "raise MissingRubyForgePackageError" do
|
71
|
+
assert_raises Jeweler::MissingRubyForgePackageError do
|
72
|
+
@command.run
|
73
|
+
end
|
74
|
+
end
|
65
75
|
end
|
66
76
|
|
67
|
-
|
77
|
+
rubyforge_command_context "rubyforge_project is not defined in gemspec" do
|
68
78
|
setup do
|
69
|
-
@rubyforge = RubyForgeStub.new
|
70
79
|
stub(@rubyforge).configure
|
71
80
|
stub(@rubyforge).login
|
72
81
|
stub(@rubyforge).add_release(nil, "zomg", "1.2.3", "pkg/zomg-1.2.3.gem")
|
73
82
|
|
74
|
-
@gempsec = Object.new
|
75
83
|
stub(@gemspec).description {"The zomg gem rocks."}
|
76
84
|
stub(@gemspec).rubyforge_project { nil }
|
77
85
|
stub(@gemspec).name {"zomg"}
|
78
86
|
|
79
|
-
@gemspec_helper = Object.new
|
80
87
|
stub(@gemspec_helper).write
|
81
88
|
stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
|
82
89
|
stub(@gemspec_helper).update_version('1.2.3')
|
83
90
|
|
84
|
-
@output = StringIO.new
|
85
|
-
|
86
|
-
@command = Jeweler::Commands::ReleaseToRubyforge.new
|
87
|
-
@command.output = @output
|
88
|
-
@command.repo = @repo
|
89
|
-
@command.gemspec = @gemspec
|
90
|
-
@command.gemspec_helper = @gemspec_helper
|
91
91
|
@command.version = '1.2.3'
|
92
|
-
@command.ruby_forge = @rubyforge
|
93
92
|
end
|
94
93
|
|
95
|
-
should "raise
|
96
|
-
assert_raises
|
94
|
+
should "raise NoRubyForgeProjectConfigured" do
|
95
|
+
assert_raises Jeweler::NoRubyForgeProjectInGemspecError do
|
97
96
|
@command.run
|
98
97
|
end
|
99
98
|
end
|
100
99
|
end
|
101
100
|
|
102
|
-
|
101
|
+
rubyforge_command_context "after running when rubyforge_project is not defined in ~/.rubyforge/auto_config.yml" do
|
103
102
|
setup do
|
104
|
-
@rubyforge = RubyForgeStub.new
|
105
103
|
stub(@rubyforge).configure
|
106
104
|
stub(@rubyforge).login
|
107
105
|
stub(@rubyforge).add_release("some_project_that_doesnt_exist", "zomg", "1.2.3", "pkg/zomg-1.2.3.gem") do
|
108
106
|
raise RuntimeError, "no <group_id> configured for <some_project_that_doesnt_exist>"
|
109
107
|
end
|
110
108
|
|
111
|
-
@
|
109
|
+
@rubyforge.autoconfig['package_ids'] = { 'zomg' => 1234 }
|
110
|
+
|
112
111
|
stub(@gemspec).description {"The zomg gem rocks."}
|
113
112
|
stub(@gemspec).rubyforge_project { "some_project_that_doesnt_exist" }
|
114
113
|
stub(@gemspec).name {"zomg"}
|
115
114
|
|
116
|
-
@gemspec_helper = Object.new
|
117
115
|
stub(@gemspec_helper).write
|
118
116
|
stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
|
119
117
|
stub(@gemspec_helper).update_version('1.2.3')
|
120
118
|
|
121
|
-
@output = StringIO.new
|
122
|
-
|
123
|
-
@command = Jeweler::Commands::ReleaseToRubyforge.new
|
124
|
-
@command.output = @output
|
125
|
-
@command.repo = @repo
|
126
|
-
@command.gemspec = @gemspec
|
127
|
-
@command.gemspec_helper = @gemspec_helper
|
128
119
|
@command.version = '1.2.3'
|
129
|
-
@command.ruby_forge = @rubyforge
|
130
120
|
end
|
131
121
|
|
132
|
-
should "raise
|
133
|
-
assert_raises
|
122
|
+
should "raise RubyForgeProjectNotConfiguredError" do
|
123
|
+
assert_raises RubyForgeProjectNotConfiguredError do
|
134
124
|
@command.run
|
135
125
|
end
|
136
126
|
end
|
137
127
|
end
|
128
|
+
|
129
|
+
build_command_context "build for jeweler" do
|
130
|
+
setup do
|
131
|
+
@command = Jeweler::Commands::ReleaseToRubyforge.build_for(@jeweler)
|
132
|
+
end
|
133
|
+
|
134
|
+
should "assign gemspec helper" do
|
135
|
+
assert_equal @gemspec_helper, @command.gemspec_helper
|
136
|
+
end
|
137
|
+
|
138
|
+
should "assign gemspec" do
|
139
|
+
assert_equal @gemspec, @command.gemspec
|
140
|
+
end
|
141
|
+
|
142
|
+
should "assign version" do
|
143
|
+
assert_equal @version, @command.version
|
144
|
+
end
|
145
|
+
|
146
|
+
should "assign output" do
|
147
|
+
assert_equal @output, @command.output
|
148
|
+
end
|
149
|
+
|
150
|
+
should "assign rubyforge" do
|
151
|
+
assert_equal @rubyforge, @command.rubyforge
|
152
|
+
end
|
153
|
+
end
|
138
154
|
|
139
155
|
end
|
140
156
|
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Jeweler
|
4
|
+
module Commands
|
5
|
+
class TestSetupRubyforge < Test::Unit::TestCase
|
6
|
+
def self.subject
|
7
|
+
Jeweler::Commands::SetupRubyforge.new
|
8
|
+
end
|
9
|
+
|
10
|
+
rubyforge_command_context "package_exists?" do
|
11
|
+
setup do
|
12
|
+
stub(@gemspec).name { 'zomg' }
|
13
|
+
end
|
14
|
+
|
15
|
+
should "be true if rubyforge.lookup doesn't cause an Error" do
|
16
|
+
mock(@rubyforge).lookup('package', 'zomg')
|
17
|
+
|
18
|
+
assert @command.package_exists?
|
19
|
+
end
|
20
|
+
|
21
|
+
should "be false if rubyforge.lookup raises an error like: no <package_id> configured for <zomg>" do
|
22
|
+
mock(@rubyforge).lookup('package', 'zomg') do
|
23
|
+
raise RuntimeError, "no <package_id> configured for <zomg>"
|
24
|
+
end
|
25
|
+
|
26
|
+
assert ! @command.package_exists?
|
27
|
+
end
|
28
|
+
|
29
|
+
should "reraise any other Errors" do
|
30
|
+
mock(@rubyforge).lookup('package', 'zomg') do
|
31
|
+
raise RuntimeError, 'burnination!'
|
32
|
+
end
|
33
|
+
|
34
|
+
assert_raises RuntimeError, 'burnination!' do
|
35
|
+
@command.package_exists?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
rubyforge_command_context "create_package" do
|
41
|
+
setup do
|
42
|
+
stub(@gemspec).name { 'zomg' }
|
43
|
+
end
|
44
|
+
|
45
|
+
context "when everything is happy" do
|
46
|
+
setup do
|
47
|
+
stub(@gemspec).rubyforge_project { 'myproject' }
|
48
|
+
stub(@rubyforge).create_package('myproject', 'zomg')
|
49
|
+
|
50
|
+
@command.create_package
|
51
|
+
end
|
52
|
+
|
53
|
+
should "create zomg package to myproject on rubyforge" do
|
54
|
+
assert_received(@rubyforge) {|rubyforge| rubyforge.create_package('myproject', 'zomg') }
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
context "when rubyforge project not existing or being setup in ~/.rubyforge/autoconfig.yml" do
|
60
|
+
setup do
|
61
|
+
stub(@gemspec).rubyforge_project { 'myproject' }
|
62
|
+
stub(@rubyforge).create_package('myproject', 'zomg')do
|
63
|
+
raise RuntimeError, "no <group_id> configured for <myproject>"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
should "raise RubyForgeProjectNotConfiguredError" do
|
68
|
+
assert_raises RubyForgeProjectNotConfiguredError do
|
69
|
+
@command.create_package
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
rubyforge_command_context "rubyforge_project defined in gemspec and project existing on rubyforge" do
|
77
|
+
setup do
|
78
|
+
stub(@rubyforge).configure
|
79
|
+
stub(@rubyforge).login
|
80
|
+
|
81
|
+
stub(@gemspec).name { 'zomg' }
|
82
|
+
stub(@gemspec).rubyforge_project { 'myproject' }
|
83
|
+
|
84
|
+
stub(@command).package_exists? { false }
|
85
|
+
stub(@command).create_package
|
86
|
+
@command.run
|
87
|
+
end
|
88
|
+
|
89
|
+
should "configure rubyforge" do
|
90
|
+
assert_received(@rubyforge) {|rubyforge| rubyforge.configure}
|
91
|
+
end
|
92
|
+
|
93
|
+
should "login to rubyforge" do
|
94
|
+
assert_received(@rubyforge) {|rubyforge| rubyforge.login}
|
95
|
+
end
|
96
|
+
|
97
|
+
should "create zomg package to myproject on rubyforge" do
|
98
|
+
assert_received(@command) {|command| command.create_package }
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
rubyforge_command_context "rubyforge_project defined in gemspec, project and project already existing on rubyforge" do
|
103
|
+
setup do
|
104
|
+
stub(@rubyforge).configure
|
105
|
+
stub(@rubyforge).login
|
106
|
+
|
107
|
+
|
108
|
+
stub(@gemspec).name { 'zomg' }
|
109
|
+
stub(@gemspec).rubyforge_project { 'myproject' }
|
110
|
+
|
111
|
+
stub(@command).package_exists? { true }
|
112
|
+
dont_allow(@command).create_package
|
113
|
+
@command.run
|
114
|
+
end
|
115
|
+
|
116
|
+
should "configure rubyforge" do
|
117
|
+
assert_received(@rubyforge) {|rubyforge| rubyforge.configure}
|
118
|
+
end
|
119
|
+
|
120
|
+
should "login to rubyforge" do
|
121
|
+
assert_received(@rubyforge) {|rubyforge| rubyforge.login}
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
rubyforge_command_context "rubyforge_project is not defined" do
|
128
|
+
setup do
|
129
|
+
stub(@gemspec).name { 'zomg' }
|
130
|
+
stub(@gemspec).rubyforge_project { nil }
|
131
|
+
end
|
132
|
+
|
133
|
+
should "raise NoRubyForgeProjectConfigured" do
|
134
|
+
assert_raises Jeweler::NoRubyForgeProjectInGemspecError do
|
135
|
+
@command.run
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
rubyforge_command_context "rubyforge project not existing or being setup in ~/.rubyforge/autoconfig.yml" do
|
141
|
+
setup do
|
142
|
+
stub(@rubyforge).configure
|
143
|
+
stub(@rubyforge).login
|
144
|
+
|
145
|
+
stub(@gemspec).name { 'zomg' }
|
146
|
+
stub(@gemspec).rubyforge_project { 'some_project_that_doesnt_exist' }
|
147
|
+
|
148
|
+
stub(@command).package_exists? { false }
|
149
|
+
stub(@command).create_package do
|
150
|
+
raise RubyForgeProjectNotConfiguredError, 'some_project_that_doesnt_exist'
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
should "raise RubyForgeProjectNotConfiguredError" do
|
155
|
+
assert_raises RubyForgeProjectNotConfiguredError do
|
156
|
+
@command.run
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
161
|
+
|
162
|
+
build_command_context "build for jeweler" do
|
163
|
+
setup do
|
164
|
+
@command = Jeweler::Commands::SetupRubyforge.build_for(@jeweler)
|
165
|
+
end
|
166
|
+
|
167
|
+
should "assign gemspec" do
|
168
|
+
assert_equal @gemspec, @command.gemspec
|
169
|
+
end
|
170
|
+
|
171
|
+
should "assign output" do
|
172
|
+
assert_equal @output, @command.output
|
173
|
+
end
|
174
|
+
|
175
|
+
should "assign rubyforge" do
|
176
|
+
assert_equal @rubyforge, @command.rubyforge
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Jeweler
|
4
|
+
module Commands
|
5
|
+
class TestValidateGemspec < Test::Unit::TestCase
|
6
|
+
|
7
|
+
build_command_context "build context" do
|
8
|
+
setup do
|
9
|
+
@command = Jeweler::Commands::ValidateGemspec.build_for(@jeweler)
|
10
|
+
end
|
11
|
+
|
12
|
+
should "assign gemspec_helper" do
|
13
|
+
assert_same @gemspec_helper, @command.gemspec_helper
|
14
|
+
end
|
15
|
+
|
16
|
+
should "assign output" do
|
17
|
+
assert_same @output, @command.output
|
18
|
+
end
|
19
|
+
|
20
|
+
should "return Jeweler::Commands::ValidateGemspec" do
|
21
|
+
assert_kind_of Jeweler::Commands::ValidateGemspec, @command
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -53,6 +53,40 @@ class Jeweler
|
|
53
53
|
|
54
54
|
end
|
55
55
|
|
56
|
+
build_command_context "building for jeweler" do
|
57
|
+
setup do
|
58
|
+
@command = Jeweler::Commands::WriteGemspec.build_for(@jeweler)
|
59
|
+
end
|
60
|
+
|
61
|
+
should "assign base_dir" do
|
62
|
+
assert_same @base_dir, @command.base_dir
|
63
|
+
end
|
64
|
+
|
65
|
+
should "assign gemspec" do
|
66
|
+
assert_same @gemspec, @command.gemspec
|
67
|
+
end
|
68
|
+
|
69
|
+
should "assign version" do
|
70
|
+
assert_same @version, @command.version
|
71
|
+
end
|
72
|
+
|
73
|
+
should "assign output" do
|
74
|
+
assert_same @output, @command.output
|
75
|
+
end
|
76
|
+
|
77
|
+
should "assign gemspec_helper" do
|
78
|
+
assert_same @gemspec_helper, @command.gemspec_helper
|
79
|
+
end
|
80
|
+
|
81
|
+
should "assign version_helper" do
|
82
|
+
assert_same @version_helper, @command.version_helper
|
83
|
+
end
|
84
|
+
|
85
|
+
should "return WriteGemspec" do
|
86
|
+
assert_kind_of Jeweler::Commands::WriteGemspec, @command
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
56
90
|
end
|
57
91
|
end
|
58
92
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Jeweler
|
4
|
+
module Commands
|
5
|
+
module Version
|
6
|
+
class TestBase < Test::Unit::TestCase
|
7
|
+
build_command_context "build for jeweler" do
|
8
|
+
setup do
|
9
|
+
@command = Jeweler::Commands::Version::Base.build_for(@jeweler)
|
10
|
+
end
|
11
|
+
|
12
|
+
should "assign repo" do
|
13
|
+
assert_equal @repo, @command.repo
|
14
|
+
end
|
15
|
+
|
16
|
+
should "assign version_helper" do
|
17
|
+
assert_equal @version_helper, @command.version_helper
|
18
|
+
end
|
19
|
+
|
20
|
+
should "assign gemspec" do
|
21
|
+
assert_equal @gemspec, @command.gemspec
|
22
|
+
end
|
23
|
+
|
24
|
+
should"assign commit" do
|
25
|
+
assert_equal @commit, @command.commit
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|