jeweler 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/.travis.yml +5 -1
- data/ChangeLog.markdown +4 -0
- data/Gemfile +23 -23
- data/Gemfile.lock +142 -0
- data/Gemfile.orig +54 -0
- data/README.markdown +3 -0
- data/Rakefile +13 -14
- data/Rakefile.orig +88 -0
- data/features/generator/test.feature +2 -2
- data/features/step_definitions/debug_steps.rb +0 -1
- data/features/step_definitions/filesystem_steps.rb +2 -3
- data/features/step_definitions/generator_steps.rb +44 -64
- data/features/step_definitions/task_steps.rb +1 -2
- data/features/support/env.rb +21 -7
- data/jeweler.gemspec +11 -6
- data/jeweler.gemspec.orig +464 -0
- data/lib/jeweler.rb +18 -19
- data/lib/jeweler/commands/build_gem.rb +2 -2
- data/lib/jeweler/commands/check_dependencies.rb +3 -3
- data/lib/jeweler/commands/install_gem.rb +1 -1
- data/lib/jeweler/commands/release_gemspec.rb +8 -10
- data/lib/jeweler/commands/release_to_git.rb +9 -5
- data/lib/jeweler/commands/validate_gemspec.rb +5 -7
- data/lib/jeweler/commands/version/base.rb +8 -13
- data/lib/jeweler/commands/version/bump_major.rb +1 -3
- data/lib/jeweler/commands/version/bump_minor.rb +1 -2
- data/lib/jeweler/commands/version/bump_patch.rb +1 -4
- data/lib/jeweler/commands/write_gemspec.rb +4 -3
- data/lib/jeweler/gemspec_helper.rb +15 -15
- data/lib/jeweler/gemspec_helper.rb.orig +91 -0
- data/lib/jeweler/generator.rb +39 -41
- data/lib/jeweler/generator/application.rb +5 -7
- data/lib/jeweler/generator/bacon_mixin.rb +2 -4
- data/lib/jeweler/generator/github_mixin.rb +1 -3
- data/lib/jeweler/generator/micronaut_mixin.rb +3 -3
- data/lib/jeweler/generator/minitest_mixin.rb +2 -3
- data/lib/jeweler/generator/options.rb +15 -19
- data/lib/jeweler/generator/rdoc_mixin.rb +1 -1
- data/lib/jeweler/generator/riot_mixin.rb +2 -3
- data/lib/jeweler/generator/rspec_mixin.rb +2 -3
- data/lib/jeweler/generator/shindo_mixin.rb +2 -3
- data/lib/jeweler/generator/shoulda_mixin.rb +2 -3
- data/lib/jeweler/generator/testspec_mixin.rb +2 -3
- data/lib/jeweler/generator/testunit_mixin.rb +1 -3
- data/lib/jeweler/generator/yard_mixin.rb +3 -4
- data/lib/jeweler/rubyforge_tasks.rb +13 -13
- data/lib/jeweler/rubygems_dot_org_tasks.rb +3 -3
- data/lib/jeweler/rubygems_tasks.rb +3 -3
- data/lib/jeweler/specification.rb +22 -11
- data/lib/jeweler/tasks.rb +57 -57
- data/lib/jeweler/templates/bacon/flunking.rb +3 -3
- data/lib/jeweler/templates/micronaut/flunking.rb +3 -3
- data/lib/jeweler/templates/minitest/flunking.rb +1 -1
- data/lib/jeweler/templates/minitest/helper.rb +3 -3
- data/lib/jeweler/templates/riot/flunking.rb +1 -1
- data/lib/jeweler/templates/rspec/flunking.rb +3 -3
- data/lib/jeweler/templates/shindo/flunking.rb +3 -3
- data/lib/jeweler/templates/testspec/flunking.rb +3 -3
- data/lib/jeweler/version_helper.rb +18 -15
- data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -1
- data/test/fixtures/existing-project-with-version-constant/Rakefile +18 -20
- data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +15 -17
- data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +2 -2
- data/test/fixtures/existing-project-with-version-plaintext/Rakefile +17 -19
- data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +15 -17
- data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +2 -2
- data/test/fixtures/existing-project-with-version-yaml/Rakefile +17 -19
- data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +15 -17
- data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +2 -2
- data/test/jeweler/commands/test_build_gem.rb +25 -28
- data/test/jeweler/commands/test_install_gem.rb +7 -7
- data/test/jeweler/commands/test_release_to_gemcutter.rb +6 -7
- data/test/jeweler/commands/test_release_to_git.rb +52 -57
- data/test/jeweler/commands/test_release_to_github.rb +112 -119
- data/test/jeweler/commands/test_validate_gemspec.rb +4 -6
- data/test/jeweler/commands/test_write_gemspec.rb +21 -24
- data/test/jeweler/commands/version/test_base.rb +9 -10
- data/test/jeweler/commands/version/test_bump_major.rb +1 -5
- data/test/jeweler/commands/version/test_bump_minor.rb +1 -2
- data/test/jeweler/commands/version/test_bump_patch.rb +1 -3
- data/test/jeweler/commands/version/test_write.rb +1 -3
- data/test/jeweler/generator/test_application.rb +22 -26
- data/test/jeweler/generator/test_options.rb +26 -27
- data/test/jeweler/test_gemspec_helper.rb +7 -7
- data/test/jeweler/test_generator.rb +31 -32
- data/test/jeweler/test_generator_initialization.rb +40 -43
- data/test/jeweler/test_generator_mixins.rb +6 -7
- data/test/jeweler/test_specification.rb +36 -43
- data/test/jeweler/test_tasks.rb +2 -3
- data/test/jeweler/test_version_helper.rb +33 -35
- data/test/shoulda_macros/jeweler_macros.rb +5 -5
- data/test/test_helper.rb +23 -25
- data/test/test_jeweler.rb +22 -25
- metadata +11 -6
@@ -3,24 +3,22 @@ require 'test_helper'
|
|
3
3
|
class Jeweler
|
4
4
|
module Commands
|
5
5
|
class TestValidateGemspec < Test::Unit::TestCase
|
6
|
-
|
7
|
-
build_command_context "build context" do
|
6
|
+
build_command_context 'build context' do
|
8
7
|
setup do
|
9
8
|
@command = Jeweler::Commands::ValidateGemspec.build_for(@jeweler)
|
10
9
|
end
|
11
10
|
|
12
|
-
should
|
11
|
+
should 'assign gemspec_helper' do
|
13
12
|
assert_same @gemspec_helper, @command.gemspec_helper
|
14
13
|
end
|
15
14
|
|
16
|
-
should
|
15
|
+
should 'assign output' do
|
17
16
|
assert_same @output, @command.output
|
18
17
|
end
|
19
18
|
|
20
|
-
should
|
19
|
+
should 'return Jeweler::Commands::ValidateGemspec' do
|
21
20
|
assert_kind_of Jeweler::Commands::ValidateGemspec, @command
|
22
21
|
end
|
23
|
-
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
@@ -3,10 +3,9 @@ require 'test_helper'
|
|
3
3
|
class Jeweler
|
4
4
|
module Commands
|
5
5
|
class TestWriteGemspec < Test::Unit::TestCase
|
6
|
-
|
7
|
-
context "after run" do
|
6
|
+
context 'after run' do
|
8
7
|
setup do
|
9
|
-
@gemspec = Gem::Specification.new {|s| s.name = 'zomg' }
|
8
|
+
@gemspec = Gem::Specification.new { |s| s.name = 'zomg' }
|
10
9
|
@gemspec_helper = Object.new
|
11
10
|
stub(@gemspec_helper).spec { @gemspec }
|
12
11
|
stub(@gemspec_helper).path { 'zomg.gemspec' }
|
@@ -15,7 +14,7 @@ class Jeweler
|
|
15
14
|
@output = StringIO.new
|
16
15
|
|
17
16
|
@version_helper = Object.new
|
18
|
-
stub(@version_helper).to_s
|
17
|
+
stub(@version_helper).to_s { '1.2.3' }
|
19
18
|
stub(@version_helper).refresh
|
20
19
|
|
21
20
|
@command = Jeweler::Commands::WriteGemspec.new
|
@@ -25,17 +24,17 @@ class Jeweler
|
|
25
24
|
@command.output = @output
|
26
25
|
@command.gemspec_helper = @gemspec_helper
|
27
26
|
|
28
|
-
# FIXME apparently rubygems doesn't use Time.now under the hood when generating a date
|
27
|
+
# FIXME: apparently rubygems doesn't use Time.now under the hood when generating a date
|
29
28
|
@now = Time.local(2008, 9, 1, 12, 0, 0)
|
30
29
|
stub(Time.now).now { @now }
|
31
30
|
end
|
32
31
|
|
33
|
-
should
|
32
|
+
should 'refresh version' do
|
34
33
|
@command.run
|
35
|
-
assert_received(@version_helper
|
34
|
+
assert_received(@version_helper, &:refresh)
|
36
35
|
end
|
37
36
|
|
38
|
-
should
|
37
|
+
should 'update gemspec version' do
|
39
38
|
@command.run
|
40
39
|
assert_equal '1.2.3', @gemspec.version.to_s
|
41
40
|
end
|
@@ -46,58 +45,56 @@ class Jeweler
|
|
46
45
|
assert_equal '2.3.4', @gemspec.version.to_s
|
47
46
|
end
|
48
47
|
|
49
|
-
should_eventually
|
48
|
+
should_eventually 'update gemspec date to the beginning of today' do
|
50
49
|
@command.run
|
51
|
-
# FIXME apparently rubygems doesn't use Time.now under the hood when generating a date
|
50
|
+
# FIXME: apparently rubygems doesn't use Time.now under the hood when generating a date
|
52
51
|
assert_equal Time.local(@now.year, @now.month, @now.day, 0, 0), @gemspec.date
|
53
52
|
end
|
54
53
|
|
55
|
-
should
|
54
|
+
should 'write gemspec' do
|
56
55
|
@command.run
|
57
|
-
assert_received(@gemspec_helper
|
56
|
+
assert_received(@gemspec_helper, &:write)
|
58
57
|
end
|
59
58
|
|
60
|
-
should_eventually
|
59
|
+
should_eventually 'output that the gemspec was written' do
|
61
60
|
@command.run
|
62
|
-
assert_equal @output.string,
|
61
|
+
assert_equal @output.string, 'Generated: tmp/zomg.gemspec'
|
63
62
|
end
|
64
|
-
|
65
63
|
end
|
66
64
|
|
67
|
-
build_command_context
|
65
|
+
build_command_context 'building for jeweler' do
|
68
66
|
setup do
|
69
67
|
@command = Jeweler::Commands::WriteGemspec.build_for(@jeweler)
|
70
68
|
end
|
71
69
|
|
72
|
-
should
|
70
|
+
should 'assign base_dir' do
|
73
71
|
assert_same @base_dir, @command.base_dir
|
74
72
|
end
|
75
73
|
|
76
|
-
should
|
74
|
+
should 'assign gemspec' do
|
77
75
|
assert_same @gemspec, @command.gemspec
|
78
76
|
end
|
79
77
|
|
80
|
-
should
|
78
|
+
should 'assign version' do
|
81
79
|
assert_same @version, @command.version
|
82
80
|
end
|
83
81
|
|
84
|
-
should
|
82
|
+
should 'assign output' do
|
85
83
|
assert_same @output, @command.output
|
86
84
|
end
|
87
85
|
|
88
|
-
should
|
86
|
+
should 'assign gemspec_helper' do
|
89
87
|
assert_same @gemspec_helper, @command.gemspec_helper
|
90
88
|
end
|
91
89
|
|
92
|
-
should
|
90
|
+
should 'assign version_helper' do
|
93
91
|
assert_same @version_helper, @command.version_helper
|
94
92
|
end
|
95
93
|
|
96
|
-
should
|
94
|
+
should 'return WriteGemspec' do
|
97
95
|
assert_kind_of Jeweler::Commands::WriteGemspec, @command
|
98
96
|
end
|
99
97
|
end
|
100
|
-
|
101
98
|
end
|
102
99
|
end
|
103
100
|
end
|
@@ -4,28 +4,28 @@ class Jeweler
|
|
4
4
|
module Commands
|
5
5
|
module Version
|
6
6
|
class TestBase < Test::Unit::TestCase
|
7
|
-
build_command_context
|
7
|
+
build_command_context 'build for jeweler' do
|
8
8
|
setup do
|
9
9
|
@command = Jeweler::Commands::Version::Base.build_for(@jeweler)
|
10
10
|
end
|
11
11
|
|
12
|
-
should
|
12
|
+
should 'assign repo' do
|
13
13
|
assert_equal @repo, @command.repo
|
14
14
|
end
|
15
15
|
|
16
|
-
should
|
16
|
+
should 'assign version_helper' do
|
17
17
|
assert_equal @version_helper, @command.version_helper
|
18
18
|
end
|
19
19
|
|
20
|
-
should
|
20
|
+
should 'assign gemspec' do
|
21
21
|
assert_equal @gemspec, @command.gemspec
|
22
22
|
end
|
23
23
|
|
24
|
-
should
|
24
|
+
should 'assign commit' do
|
25
25
|
assert_equal @commit, @command.commit
|
26
26
|
end
|
27
27
|
|
28
|
-
context
|
28
|
+
context 'commit_version' do
|
29
29
|
setup do
|
30
30
|
@dir = Object.new
|
31
31
|
stub(@repo).dir { @dir }
|
@@ -40,9 +40,9 @@ class Jeweler
|
|
40
40
|
@command.commit_version
|
41
41
|
end
|
42
42
|
|
43
|
-
should
|
44
|
-
assert_received(@repo) {|repo| repo.add('VERSION')}
|
45
|
-
assert_received(@repo) {|repo| repo.commit('Version bump to 1.0.0')}
|
43
|
+
should 'add VERSION' do
|
44
|
+
assert_received(@repo) { |repo| repo.add('VERSION') }
|
45
|
+
assert_received(@repo) { |repo| repo.commit('Version bump to 1.0.0') }
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -50,4 +50,3 @@ class Jeweler
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
@@ -4,8 +4,7 @@ class Jeweler
|
|
4
4
|
module Commands
|
5
5
|
module Version
|
6
6
|
class TestBumpMajor < Test::Unit::TestCase
|
7
|
-
|
8
|
-
should "call bump_major on version_helper in update_version" do
|
7
|
+
should 'call bump_major on version_helper in update_version' do
|
9
8
|
mock(version_helper = Object.new).bump_major
|
10
9
|
|
11
10
|
command = Jeweler::Commands::Version::BumpMajor.new
|
@@ -14,9 +13,6 @@ class Jeweler
|
|
14
13
|
command.update_version
|
15
14
|
end
|
16
15
|
end
|
17
|
-
|
18
16
|
end
|
19
17
|
end
|
20
18
|
end
|
21
|
-
|
22
|
-
|
@@ -4,8 +4,7 @@ class Jeweler
|
|
4
4
|
module Commands
|
5
5
|
module Version
|
6
6
|
class TestBumpMinor < Test::Unit::TestCase
|
7
|
-
|
8
|
-
should "call bump_minor on version_helper in update_version" do
|
7
|
+
should 'call bump_minor on version_helper in update_version' do
|
9
8
|
mock(version_helper = Object.new).bump_minor
|
10
9
|
|
11
10
|
command = Jeweler::Commands::Version::BumpMinor.new
|
@@ -4,8 +4,7 @@ class Jeweler
|
|
4
4
|
module Commands
|
5
5
|
module Version
|
6
6
|
class TestBumpPatch < Test::Unit::TestCase
|
7
|
-
|
8
|
-
should "call bump_patch on version_helper in update_version" do
|
7
|
+
should 'call bump_patch on version_helper in update_version' do
|
9
8
|
mock(version_helper = Object.new).bump_patch
|
10
9
|
|
11
10
|
command = Jeweler::Commands::Version::BumpPatch.new
|
@@ -17,4 +16,3 @@ class Jeweler
|
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
20
|
-
|
@@ -4,8 +4,7 @@ class Jeweler
|
|
4
4
|
module Commands
|
5
5
|
module Version
|
6
6
|
class TestWrite < Test::Unit::TestCase
|
7
|
-
|
8
|
-
should "call write_version on version_helper in update_version" do
|
7
|
+
should 'call write_version on version_helper in update_version' do
|
9
8
|
mock(version_helper = Object.new).update_to 1, 2, 3, nil
|
10
9
|
|
11
10
|
command = Jeweler::Commands::Version::Write.new
|
@@ -19,4 +18,3 @@ class Jeweler
|
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
22
|
-
|
@@ -37,38 +37,36 @@ class TestApplication < Test::Unit::TestCase
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
context "when options indicate version" do
|
40
|
+
context 'when options indicate version' do
|
42
41
|
setup do
|
43
42
|
stub(Jeweler::Generator::Application).build_opts do
|
44
|
-
stub_options(:
|
43
|
+
stub_options(show_version: true)
|
45
44
|
end
|
46
45
|
|
47
|
-
stub(Jeweler::Generator).new { raise "Shouldn't have made this far"}
|
46
|
+
stub(Jeweler::Generator).new { raise "Shouldn't have made this far" }
|
48
47
|
|
49
48
|
assert_nothing_raised do
|
50
|
-
@result = run_application(
|
49
|
+
@result = run_application('-v')
|
51
50
|
end
|
52
51
|
end
|
53
|
-
|
52
|
+
|
54
53
|
should_exit_with_code 1
|
55
|
-
|
54
|
+
|
56
55
|
should 'should puts option version' do
|
57
56
|
assert_match 'Version:', @stderr
|
58
57
|
end
|
59
58
|
end
|
60
|
-
|
61
59
|
|
62
|
-
context
|
60
|
+
context 'when options indicate help usage' do
|
63
61
|
setup do
|
64
62
|
stub(Jeweler::Generator::Application).build_opts do
|
65
|
-
stub_options(:
|
63
|
+
stub_options(show_help: true)
|
66
64
|
end
|
67
65
|
|
68
|
-
stub(Jeweler::Generator).new { raise "Shouldn't have made this far"}
|
66
|
+
stub(Jeweler::Generator).new { raise "Shouldn't have made this far" }
|
69
67
|
|
70
68
|
assert_nothing_raised do
|
71
|
-
@result = run_application(
|
69
|
+
@result = run_application('-h')
|
72
70
|
end
|
73
71
|
end
|
74
72
|
|
@@ -83,16 +81,16 @@ class TestApplication < Test::Unit::TestCase
|
|
83
81
|
end
|
84
82
|
end
|
85
83
|
|
86
|
-
context
|
84
|
+
context 'when options indicate an invalid argument' do
|
87
85
|
setup do
|
88
86
|
stub(Jeweler::Generator::Application).build_opts do
|
89
|
-
stub_options(:
|
87
|
+
stub_options(invalid_argument: '--invalid-argument')
|
90
88
|
end
|
91
89
|
|
92
|
-
stub(Jeweler::Generator).new { raise "Shouldn't have made this far"}
|
90
|
+
stub(Jeweler::Generator).new { raise "Shouldn't have made this far" }
|
93
91
|
|
94
92
|
assert_nothing_raised do
|
95
|
-
@result = run_application(
|
93
|
+
@result = run_application('--invalid-argument')
|
96
94
|
end
|
97
95
|
end
|
98
96
|
|
@@ -109,34 +107,32 @@ class TestApplication < Test::Unit::TestCase
|
|
109
107
|
should 'not display anything on stdout' do
|
110
108
|
assert_equal '', @stdout.squeeze.strip
|
111
109
|
end
|
112
|
-
|
113
110
|
end
|
114
111
|
|
115
|
-
context
|
112
|
+
context 'when options are good' do
|
116
113
|
setup do
|
117
|
-
@generator =
|
114
|
+
@generator = 'generator'
|
118
115
|
stub(@generator).run
|
119
116
|
stub(Jeweler::Generator).new { @generator }
|
120
117
|
|
121
|
-
@jeweler_options = stub_options :
|
118
|
+
@jeweler_options = stub_options project_name: 'zomg'
|
122
119
|
stub(Jeweler::Generator::Application).build_options do
|
123
120
|
@jeweler_options
|
124
121
|
end
|
125
122
|
|
126
123
|
assert_nothing_raised do
|
127
|
-
@result = run_application(
|
124
|
+
@result = run_application('zomg')
|
128
125
|
end
|
129
126
|
end
|
130
127
|
|
131
128
|
should_exit_with_code 0
|
132
129
|
|
133
|
-
should
|
134
|
-
assert_received(Jeweler::Generator) {|subject| subject.new(@jeweler_options) }
|
130
|
+
should 'create generator with options' do
|
131
|
+
assert_received(Jeweler::Generator) { |subject| subject.new(@jeweler_options) }
|
135
132
|
end
|
136
133
|
|
137
|
-
should
|
138
|
-
assert_received(@generator
|
134
|
+
should 'run generator' do
|
135
|
+
assert_received(@generator, &:run)
|
139
136
|
end
|
140
137
|
end
|
141
|
-
|
142
138
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class TestOptions < Test::Unit::TestCase
|
4
|
-
|
5
4
|
def setup
|
6
5
|
set_default_git_config
|
7
6
|
stub_git_config valid_git_config
|
@@ -21,17 +20,17 @@ class TestOptions < Test::Unit::TestCase
|
|
21
20
|
|
22
21
|
def setup_options(*arguments)
|
23
22
|
stub(Jeweler::Generator::Options).git_config { valid_git_config }
|
24
|
-
@options = Jeweler::Generator::Options.new([
|
23
|
+
@options = Jeweler::Generator::Options.new(['project_name'] + arguments)
|
25
24
|
end
|
26
25
|
|
27
26
|
def self.for_options(*options)
|
28
27
|
context options.join(' ') do
|
29
|
-
setup { setup_options
|
28
|
+
setup { setup_options(*options) }
|
30
29
|
yield
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
context
|
33
|
+
context 'default options' do
|
35
34
|
setup { setup_options }
|
36
35
|
should_have_testing_framework :shoulda
|
37
36
|
should_have_docmentation_framework :rdoc
|
@@ -40,27 +39,27 @@ class TestOptions < Test::Unit::TestCase
|
|
40
39
|
assert ! @options[:create_repo]
|
41
40
|
end
|
42
41
|
|
43
|
-
should
|
44
|
-
assert_equal
|
42
|
+
should 'have project name' do
|
43
|
+
assert_equal 'project_name', @options[:project_name]
|
45
44
|
end
|
46
45
|
|
47
|
-
should
|
46
|
+
should 'use github username from git config' do
|
48
47
|
assert_equal @github_user, @options[:github_username]
|
49
48
|
end
|
50
|
-
should
|
49
|
+
should 'use user name from git config' do
|
51
50
|
assert_equal @git_name, @options[:user_name]
|
52
51
|
end
|
53
52
|
|
54
|
-
should
|
53
|
+
should 'use user email from git config' do
|
55
54
|
assert_equal @git_email, @options[:user_email]
|
56
55
|
end
|
57
56
|
|
58
|
-
should
|
57
|
+
should 'use bundler' do
|
59
58
|
assert @options[:use_bundler]
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
63
|
-
for_options
|
62
|
+
for_options '--bacon' do
|
64
63
|
should_have_testing_framework :bacon
|
65
64
|
end
|
66
65
|
|
@@ -80,11 +79,11 @@ class TestOptions < Test::Unit::TestCase
|
|
80
79
|
should_have_testing_framework :shoulda
|
81
80
|
end
|
82
81
|
|
83
|
-
for_options
|
82
|
+
for_options '--testunit' do
|
84
83
|
should_have_testing_framework :testunit
|
85
84
|
end
|
86
85
|
|
87
|
-
for_options
|
86
|
+
for_options '--testspec' do
|
88
87
|
should_have_testing_framework :testspec
|
89
88
|
end
|
90
89
|
|
@@ -137,13 +136,13 @@ class TestOptions < Test::Unit::TestCase
|
|
137
136
|
assert_equal 'foo', @options[:directory]
|
138
137
|
end
|
139
138
|
end
|
140
|
-
|
139
|
+
|
141
140
|
for_options '--version' do
|
142
141
|
should 'show version' do
|
143
142
|
assert @options[:show_version]
|
144
143
|
end
|
145
144
|
end
|
146
|
-
|
145
|
+
|
147
146
|
for_options '-v' do
|
148
147
|
should 'show version' do
|
149
148
|
assert @options[:show_version]
|
@@ -169,13 +168,13 @@ class TestOptions < Test::Unit::TestCase
|
|
169
168
|
end
|
170
169
|
|
171
170
|
for_options '--user-name', 'myname' do
|
172
|
-
should
|
171
|
+
should 'set user name' do
|
173
172
|
assert_equal 'myname', @options[:user_name]
|
174
173
|
end
|
175
174
|
end
|
176
175
|
|
177
176
|
for_options '--user-email', 'myname@mydomain.com' do
|
178
|
-
should
|
177
|
+
should 'set user email' do
|
179
178
|
assert_equal 'myname@mydomain.com', @options[:user_email]
|
180
179
|
end
|
181
180
|
end
|
@@ -193,34 +192,34 @@ class TestOptions < Test::Unit::TestCase
|
|
193
192
|
end
|
194
193
|
|
195
194
|
for_options '--github-username', 'mygithub' do
|
196
|
-
should
|
195
|
+
should 'set github username' do
|
197
196
|
assert_equal 'mygithub', @options[:github_username]
|
198
197
|
end
|
199
198
|
end
|
200
199
|
|
201
200
|
for_options '--bundler' do
|
202
|
-
should
|
201
|
+
should 'use bundler' do
|
203
202
|
assert @options[:use_bundler]
|
204
203
|
end
|
205
204
|
end
|
206
205
|
|
207
206
|
for_options '--no-bundler' do
|
208
|
-
should
|
207
|
+
should 'not use bundler' do
|
209
208
|
assert !@options[:use_bundler]
|
210
209
|
end
|
211
210
|
end
|
212
211
|
|
213
|
-
context
|
214
|
-
should
|
215
|
-
options = Jeweler::Generator::Options.new([
|
216
|
-
|
212
|
+
context 'merging options' do
|
213
|
+
should 'take options from each' do
|
214
|
+
options = Jeweler::Generator::Options.new(['--rspec'])
|
215
|
+
.merge Jeweler::Generator::Options.new(['--create-repo'])
|
217
216
|
assert_equal :rspec, options[:testing_framework]
|
218
217
|
assert options[:create_repo]
|
219
218
|
end
|
220
219
|
|
221
|
-
should
|
222
|
-
options = Jeweler::Generator::Options.new([
|
223
|
-
|
220
|
+
should 'shadow options' do
|
221
|
+
options = Jeweler::Generator::Options.new(['--bacon'])
|
222
|
+
.merge Jeweler::Generator::Options.new(['--rspec'])
|
224
223
|
assert_equal :rspec, options[:testing_framework]
|
225
224
|
end
|
226
225
|
end
|