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
@@ -2,10 +2,10 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class TestGemspecHelper < Test::Unit::TestCase
|
4
4
|
def setup
|
5
|
-
Rake.application.instance_variable_set(:@rakefile,
|
5
|
+
Rake.application.instance_variable_set(:@rakefile, 'Rakefile')
|
6
6
|
end
|
7
7
|
|
8
|
-
context
|
8
|
+
context 'given a gemspec' do
|
9
9
|
setup do
|
10
10
|
@spec = build_spec
|
11
11
|
@helper = Jeweler::GemSpecHelper.new(@spec, File.dirname(__FILE__))
|
@@ -16,7 +16,7 @@ class TestGemspecHelper < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
context
|
19
|
+
context '#write' do
|
20
20
|
setup do
|
21
21
|
@spec = build_spec
|
22
22
|
@helper = Jeweler::GemSpecHelper.new(@spec, File.dirname(__FILE__))
|
@@ -29,15 +29,15 @@ class TestGemspecHelper < Test::Unit::TestCase
|
|
29
29
|
FileUtils.rm_f(@helper.path)
|
30
30
|
end
|
31
31
|
|
32
|
-
should
|
33
|
-
assert File.
|
32
|
+
should 'create gemspec file' do
|
33
|
+
assert File.exist?(@helper.path)
|
34
34
|
end
|
35
35
|
|
36
|
-
should
|
36
|
+
should 'make valid spec' do
|
37
37
|
assert @helper.valid?
|
38
38
|
end
|
39
39
|
|
40
|
-
should
|
40
|
+
should 'parse' do
|
41
41
|
@helper.parse
|
42
42
|
end
|
43
43
|
end
|
@@ -3,48 +3,48 @@ require 'test_helper'
|
|
3
3
|
class TestGenerator < Test::Unit::TestCase
|
4
4
|
def build_generator(testing_framework = :shoulda, options = {})
|
5
5
|
options = {
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
6
|
+
project_name: 'the-perfect-gem',
|
7
|
+
user_name: 'John Doe',
|
8
|
+
user_email: 'john@example.com',
|
9
|
+
github_username: 'johndoe',
|
10
|
+
documentation_framework: :rdoc
|
11
11
|
}.merge(options)
|
12
12
|
|
13
13
|
options[:testing_framework] = testing_framework
|
14
14
|
Jeweler::Generator.new(options)
|
15
15
|
end
|
16
16
|
|
17
|
-
should
|
18
|
-
assert_equal
|
17
|
+
should 'have the correct constant name' do
|
18
|
+
assert_equal 'ThePerfectGem', build_generator.constant_name
|
19
19
|
end
|
20
20
|
|
21
|
-
should
|
22
|
-
assert_equal
|
21
|
+
should 'have the correct file name prefix' do
|
22
|
+
assert_equal 'the_perfect_gem', build_generator.file_name_prefix
|
23
23
|
end
|
24
24
|
|
25
|
-
should
|
26
|
-
assert_equal
|
25
|
+
should 'have the correct require name' do
|
26
|
+
assert_equal 'the-perfect-gem', build_generator.require_name
|
27
27
|
end
|
28
28
|
|
29
|
-
should
|
30
|
-
assert_equal
|
29
|
+
should 'have the correct lib file name' do
|
30
|
+
assert_equal 'the-perfect-gem.rb', build_generator.lib_filename
|
31
31
|
end
|
32
|
-
|
33
|
-
should
|
34
|
-
assert_equal 'user@host:/path/to/repo', build_generator(:shoulda,
|
35
|
-
assert_equal 'git@github.com:johndoe/the-perfect-gem.git', build_generator.git_remote
|
32
|
+
|
33
|
+
should 'have the correct git-remote' do
|
34
|
+
assert_equal 'user@host:/path/to/repo', build_generator(:shoulda, git_remote: 'user@host:/path/to/repo').git_remote
|
35
|
+
assert_equal 'git@github.com:johndoe/the-perfect-gem.git', build_generator.git_remote
|
36
36
|
end
|
37
37
|
|
38
|
-
should
|
39
|
-
assert_equal
|
38
|
+
should 'extract project name from absolut path' do
|
39
|
+
assert_equal 'my-project', build_generator(:shoulda, project_name: '/tmp/my-project').project_name
|
40
40
|
end
|
41
41
|
|
42
|
-
should
|
43
|
-
assert_equal
|
42
|
+
should 'extract project name from relative path' do
|
43
|
+
assert_equal 'my-project', build_generator(:shoulda, project_name: '../my-project').project_name
|
44
44
|
end
|
45
45
|
|
46
|
-
should
|
47
|
-
assert_equal
|
46
|
+
should 'extract project name from direct path' do
|
47
|
+
assert_equal 'my-project', build_generator(:shoulda, project_name: 'my-project').project_name
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.should_have_generator_attribute(attribute, value)
|
@@ -53,7 +53,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
context
|
56
|
+
context 'shoulda' do
|
57
57
|
setup { @framework = :shoulda }
|
58
58
|
should_have_generator_attribute :test_task, 'test'
|
59
59
|
should_have_generator_attribute :test_dir, 'test'
|
@@ -65,7 +65,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
65
65
|
should_have_generator_attribute :test_helper_filename, 'helper.rb'
|
66
66
|
end
|
67
67
|
|
68
|
-
context
|
68
|
+
context 'testunit' do
|
69
69
|
setup { @framework = :testunit }
|
70
70
|
should_have_generator_attribute :test_task, 'test'
|
71
71
|
should_have_generator_attribute :test_dir, 'test'
|
@@ -77,7 +77,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
77
77
|
should_have_generator_attribute :test_helper_filename, 'helper.rb'
|
78
78
|
end
|
79
79
|
|
80
|
-
context
|
80
|
+
context 'minitest' do
|
81
81
|
setup { @framework = :minitest }
|
82
82
|
should_have_generator_attribute :test_task, 'test'
|
83
83
|
should_have_generator_attribute :test_dir, 'test'
|
@@ -89,7 +89,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
89
89
|
should_have_generator_attribute :test_helper_filename, 'helper.rb'
|
90
90
|
end
|
91
91
|
|
92
|
-
context
|
92
|
+
context 'bacon' do
|
93
93
|
setup { @framework = :bacon }
|
94
94
|
should_have_generator_attribute :test_task, 'spec'
|
95
95
|
should_have_generator_attribute :test_dir, 'spec'
|
@@ -101,7 +101,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
101
101
|
should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
|
102
102
|
end
|
103
103
|
|
104
|
-
context
|
104
|
+
context 'rspec' do
|
105
105
|
setup { @framework = :rspec }
|
106
106
|
should_have_generator_attribute :test_task, 'spec'
|
107
107
|
should_have_generator_attribute :test_dir, 'spec'
|
@@ -113,7 +113,7 @@ class TestGenerator < Test::Unit::TestCase
|
|
113
113
|
should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
|
114
114
|
end
|
115
115
|
|
116
|
-
context
|
116
|
+
context 'micronaut' do
|
117
117
|
setup { @framework = :micronaut }
|
118
118
|
should_have_generator_attribute :test_task, 'examples'
|
119
119
|
should_have_generator_attribute :test_dir, 'examples'
|
@@ -124,8 +124,8 @@ class TestGenerator < Test::Unit::TestCase
|
|
124
124
|
should_have_generator_attribute :test_filename, 'the-perfect-gem_example.rb'
|
125
125
|
should_have_generator_attribute :test_helper_filename, 'example_helper.rb'
|
126
126
|
end
|
127
|
-
|
128
|
-
context
|
127
|
+
|
128
|
+
context 'testspec' do
|
129
129
|
setup { @framework = :testspec }
|
130
130
|
should_have_generator_attribute :test_task, 'test'
|
131
131
|
should_have_generator_attribute :test_dir, 'test'
|
@@ -136,5 +136,4 @@ class TestGenerator < Test::Unit::TestCase
|
|
136
136
|
should_have_generator_attribute :test_filename, 'the-perfect-gem_test.rb'
|
137
137
|
should_have_generator_attribute :test_helper_filename, 'test_helper.rb'
|
138
138
|
end
|
139
|
-
|
140
139
|
end
|
@@ -5,88 +5,88 @@ class TestGeneratorInitialization < Test::Unit::TestCase
|
|
5
5
|
set_default_git_config
|
6
6
|
end
|
7
7
|
|
8
|
-
context
|
8
|
+
context 'given a nil github repo name' do
|
9
9
|
setup do
|
10
10
|
stub_git_config
|
11
11
|
end
|
12
12
|
|
13
13
|
should 'raise NoGithubRepoNameGiven' do
|
14
14
|
assert_raise Jeweler::NoGitHubRepoNameGiven do
|
15
|
-
Jeweler::Generator.new
|
15
|
+
Jeweler::Generator.new
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
context "without git user's name set" do
|
21
21
|
setup do
|
22
|
-
stub_git_config
|
22
|
+
stub_git_config
|
23
23
|
end
|
24
24
|
|
25
25
|
should 'raise an NoGitUserName' do
|
26
26
|
assert_raise Jeweler::NoGitUserName do
|
27
|
-
Jeweler::Generator.new(:
|
27
|
+
Jeweler::Generator.new(project_name: @project_name, testing_framework: :shoulda, documentation_framework: :rdoc)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context "without git user's email set" do
|
33
33
|
setup do
|
34
|
-
stub_git_config
|
34
|
+
stub_git_config
|
35
35
|
end
|
36
36
|
|
37
37
|
should 'raise NoGitUserEmail' do
|
38
38
|
assert_raise Jeweler::NoGitUserEmail do
|
39
|
-
Jeweler::Generator.new(:
|
39
|
+
Jeweler::Generator.new(project_name: @project_name, user_name: @git_name, testing_framework: :shoulda, documentation_framework: :rdoc)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
context
|
44
|
+
context 'without github username set' do
|
45
45
|
setup do
|
46
46
|
stub_git_config
|
47
47
|
end
|
48
48
|
|
49
49
|
should 'raise NotGitHubUser' do
|
50
50
|
assert_raise Jeweler::NoGitHubUser do
|
51
|
-
Jeweler::Generator.new(:
|
51
|
+
Jeweler::Generator.new(project_name: @project_name, user_name: @git_name, user_email: @git_email, testing_framework: :shoulda, documentation_framework: :rdoc)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
55
55
|
def build_generator(options = {})
|
56
|
-
defaults = { :
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
56
|
+
defaults = { project_name: @project_name,
|
57
|
+
user_name: @git_name,
|
58
|
+
user_email: @git_email,
|
59
|
+
github_username: @github_user,
|
60
|
+
testing_framework: :shoulda,
|
61
|
+
documentation_framework: :rdoc }
|
62
62
|
|
63
63
|
options = defaults.merge(options)
|
64
|
-
Jeweler::Generator.new(options)
|
64
|
+
Jeweler::Generator.new(options)
|
65
65
|
end
|
66
66
|
|
67
|
-
context
|
67
|
+
context 'default configuration' do
|
68
68
|
setup do
|
69
69
|
stub_git_config
|
70
70
|
@generator = build_generator
|
71
71
|
end
|
72
72
|
|
73
|
-
should
|
73
|
+
should 'use shoulda for testing' do
|
74
74
|
assert_equal :shoulda, @generator.testing_framework
|
75
75
|
end
|
76
76
|
|
77
|
-
should
|
77
|
+
should 'use rdoc for documentation' do
|
78
78
|
assert_equal :rdoc, @generator.documentation_framework
|
79
79
|
end
|
80
80
|
|
81
|
-
should
|
82
|
-
assert_match
|
81
|
+
should 'set todo in summary' do
|
82
|
+
assert_match(/todo/i, @generator.summary)
|
83
83
|
end
|
84
84
|
|
85
|
-
should
|
86
|
-
assert_match
|
85
|
+
should 'set todo in description' do
|
86
|
+
assert_match(/todo/i, @generator.description)
|
87
87
|
end
|
88
88
|
|
89
|
-
should
|
89
|
+
should 'set target directory to the project name' do
|
90
90
|
assert_equal @project_name, File.split(@generator.target_dir).last
|
91
91
|
end
|
92
92
|
|
@@ -94,57 +94,54 @@ class TestGeneratorInitialization < Test::Unit::TestCase
|
|
94
94
|
assert_equal @git_name, @generator.user_name
|
95
95
|
end
|
96
96
|
|
97
|
-
should
|
97
|
+
should 'set email from git config' do
|
98
98
|
assert_equal @git_email, @generator.user_email
|
99
99
|
end
|
100
100
|
|
101
|
-
should
|
101
|
+
should 'set origin remote as github, based on username and project name' do
|
102
102
|
assert_equal "git@github.com:#{@github_user}/#{@project_name}.git", @generator.git_remote
|
103
103
|
end
|
104
104
|
|
105
|
-
should
|
105
|
+
should 'set homepage as github based on username and project name' do
|
106
106
|
assert_equal "http://github.com/#{@github_user}/#{@project_name}", @generator.homepage
|
107
107
|
end
|
108
108
|
|
109
|
-
should
|
109
|
+
should 'set github username from git config' do
|
110
110
|
assert_equal @github_user, @generator.github_username
|
111
111
|
end
|
112
112
|
|
113
|
-
should
|
113
|
+
should 'set project name as the-perfect-gem' do
|
114
114
|
assert_equal @project_name, @generator.project_name
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
-
context
|
118
|
+
context 'using yard' do
|
119
119
|
setup do
|
120
|
-
@generator = build_generator(:
|
120
|
+
@generator = build_generator(documentation_framework: :yard)
|
121
121
|
end
|
122
122
|
|
123
|
-
should
|
124
|
-
assert_equal
|
123
|
+
should 'set the doc_task to yardoc' do
|
124
|
+
assert_equal 'yardoc', @generator.doc_task
|
125
125
|
end
|
126
|
-
|
127
126
|
end
|
128
127
|
|
129
|
-
context
|
128
|
+
context 'using rdoc' do
|
130
129
|
setup do
|
131
|
-
@generator = build_generator(:
|
130
|
+
@generator = build_generator(documentation_framework: :rdoc)
|
132
131
|
end
|
133
132
|
|
134
|
-
should
|
135
|
-
assert_equal
|
133
|
+
should 'set the doc_task to rdoc' do
|
134
|
+
assert_equal 'rdoc', @generator.doc_task
|
136
135
|
end
|
137
136
|
end
|
138
137
|
|
139
|
-
context
|
138
|
+
context 'using a custom homepage' do
|
140
139
|
setup do
|
141
|
-
@generator = build_generator(:
|
140
|
+
@generator = build_generator(homepage: 'http://zomg.com')
|
142
141
|
end
|
143
142
|
|
144
|
-
should
|
145
|
-
assert_equal
|
143
|
+
should 'set the homepage' do
|
144
|
+
assert_equal 'http://zomg.com', @generator.homepage
|
146
145
|
end
|
147
|
-
|
148
146
|
end
|
149
|
-
|
150
147
|
end
|
@@ -1,23 +1,22 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class TestGeneratorMixins < Test::Unit::TestCase
|
4
|
-
|
5
4
|
[Jeweler::Generator::BaconMixin,
|
6
5
|
Jeweler::Generator::MicronautMixin,
|
7
6
|
Jeweler::Generator::MinitestMixin,
|
8
7
|
Jeweler::Generator::RspecMixin,
|
9
8
|
Jeweler::Generator::ShouldaMixin,
|
10
9
|
Jeweler::Generator::TestspecMixin,
|
11
|
-
Jeweler::Generator::TestunitMixin
|
10
|
+
Jeweler::Generator::TestunitMixin
|
12
11
|
].each do |mixin|
|
13
|
-
context
|
12
|
+
context mixin.to_s do
|
14
13
|
%w(default_task feature_support_require feature_support_extend
|
15
14
|
test_dir test_task test_pattern test_filename
|
16
15
|
test_helper_filename).each do |method|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
should "define #{method}" do
|
17
|
+
assert mixin.method_defined?(method)
|
18
|
+
end
|
19
|
+
end
|
21
20
|
end
|
22
21
|
end
|
23
22
|
end
|
@@ -13,37 +13,36 @@ class TestSpecification < Test::Unit::TestCase
|
|
13
13
|
gemspec = if block
|
14
14
|
Gem::Specification.new(&block)
|
15
15
|
else
|
16
|
-
Gem::Specification.new
|
16
|
+
Gem::Specification.new
|
17
17
|
end
|
18
18
|
gemspec.extend(Jeweler::Specification)
|
19
19
|
gemspec
|
20
20
|
end
|
21
21
|
|
22
|
-
should
|
22
|
+
should 'be able to use to_ruby on a duped gemspec without error' do
|
23
23
|
gemspec = build_jeweler_gemspec
|
24
24
|
gemspec.files.include 'throwaway value'
|
25
25
|
|
26
26
|
gemspec.dup.to_ruby
|
27
27
|
end
|
28
28
|
|
29
|
-
context
|
29
|
+
context 'basic defaults' do
|
30
30
|
setup do
|
31
31
|
@gemspec = build_jeweler_gemspec
|
32
32
|
end
|
33
33
|
|
34
|
-
should
|
34
|
+
should 'make files a FileList' do
|
35
35
|
assert_equal FileList, @gemspec.files.class
|
36
36
|
end
|
37
37
|
|
38
|
-
should
|
38
|
+
should 'make extra_rdoc_files a FileList' do
|
39
39
|
assert_equal FileList, @gemspec.extra_rdoc_files.class
|
40
40
|
end
|
41
|
-
|
42
41
|
end
|
43
|
-
|
42
|
+
|
44
43
|
context "there aren't any executables in the project directory" do
|
45
44
|
setup do
|
46
|
-
@project.directory 'bin'
|
45
|
+
@project.directory 'bin'
|
47
46
|
end
|
48
47
|
|
49
48
|
context "and there hasn't been any set on the gemspec" do
|
@@ -52,27 +51,26 @@ class TestSpecification < Test::Unit::TestCase
|
|
52
51
|
@gemspec.set_jeweler_defaults(@project)
|
53
52
|
end
|
54
53
|
|
55
|
-
|
56
|
-
should "have empty gemspec executables" do
|
54
|
+
should 'have empty gemspec executables' do
|
57
55
|
assert_equal [], @gemspec.executables
|
58
56
|
end
|
59
57
|
end
|
60
58
|
|
61
|
-
context
|
59
|
+
context 'and has been previously set executables' do
|
62
60
|
setup do
|
63
|
-
@gemspec
|
61
|
+
@gemspec = build_jeweler_gemspec do |gemspec|
|
64
62
|
gemspec.executables = %w(non-existant)
|
65
63
|
end
|
66
64
|
@gemspec.set_jeweler_defaults(@project)
|
67
65
|
end
|
68
66
|
|
69
|
-
should
|
67
|
+
should 'have only the original executables in the gemspec' do
|
70
68
|
assert_equal %w(non-existant), @gemspec.executables
|
71
69
|
end
|
72
70
|
end
|
73
71
|
end
|
74
72
|
|
75
|
-
context
|
73
|
+
context 'there are multiple executables in the project directory' do
|
76
74
|
setup do
|
77
75
|
@project.directory('bin') do |bin|
|
78
76
|
bin.file 'burnination'
|
@@ -87,28 +85,28 @@ class TestSpecification < Test::Unit::TestCase
|
|
87
85
|
|
88
86
|
context "and there hasn't been any set on the gemspec" do
|
89
87
|
setup do
|
90
|
-
@gemspec
|
88
|
+
@gemspec = build_jeweler_gemspec
|
91
89
|
@gemspec.set_jeweler_defaults(@project)
|
92
90
|
end
|
93
91
|
|
94
|
-
should
|
92
|
+
should 'have the executables under version control in the gemspec' do
|
95
93
|
assert_equal %w(burnination), @gemspec.executables
|
96
94
|
end
|
97
95
|
end
|
98
|
-
context
|
96
|
+
context 'and has been previously set executables' do
|
99
97
|
setup do
|
100
|
-
@gemspec
|
98
|
+
@gemspec = build_jeweler_gemspec do |gemspec|
|
101
99
|
gemspec.executables = %w(burnination)
|
102
100
|
end
|
103
101
|
@gemspec.set_jeweler_defaults(@project)
|
104
102
|
end
|
105
|
-
should
|
103
|
+
should 'have only the original executables in the gemspec' do
|
106
104
|
assert_equal %w(burnination), @gemspec.executables
|
107
105
|
end
|
108
106
|
end
|
109
107
|
end
|
110
108
|
|
111
|
-
context
|
109
|
+
context 'there are mutiple extconf.rb and mkrf_conf.rb in the project directory' do
|
112
110
|
setup do
|
113
111
|
@project.directory('ext') do |ext|
|
114
112
|
ext.file 'extconf.rb'
|
@@ -122,19 +120,17 @@ class TestSpecification < Test::Unit::TestCase
|
|
122
120
|
|
123
121
|
context "and there hasn't been any extensions set on the gemspec" do
|
124
122
|
setup do
|
125
|
-
@gemspec
|
123
|
+
@gemspec = build_jeweler_gemspec
|
126
124
|
@gemspec.set_jeweler_defaults(@project)
|
127
125
|
end
|
128
126
|
|
129
|
-
should
|
127
|
+
should 'have all the extconf.rb and mkrf_config.rb files in extensions' do
|
130
128
|
assert_equal %w(ext/mkrf_conf.rb ext/trogdor_native/mkrf_conf.rb ext/extconf.rb ext/trogdor_native/extconf.rb).sort, @gemspec.extensions.sort
|
131
129
|
end
|
132
|
-
|
133
130
|
end
|
134
|
-
|
135
131
|
end
|
136
132
|
|
137
|
-
context
|
133
|
+
context 'there are some files and is setup for git' do
|
138
134
|
setup do
|
139
135
|
@project.file 'Rakefile'
|
140
136
|
@project.directory('lib') do |lib|
|
@@ -148,33 +144,32 @@ class TestSpecification < Test::Unit::TestCase
|
|
148
144
|
repo.commit('Initial commit')
|
149
145
|
end
|
150
146
|
|
151
|
-
context
|
147
|
+
context 'and the files defaults are used' do
|
152
148
|
setup do
|
153
|
-
@gemspec
|
149
|
+
@gemspec = build_jeweler_gemspec
|
154
150
|
@gemspec.set_jeweler_defaults(@project, @project)
|
155
151
|
end
|
156
152
|
|
157
|
-
should
|
153
|
+
should 'populate files from git' do
|
158
154
|
assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
|
159
155
|
end
|
160
156
|
end
|
161
157
|
|
162
|
-
context
|
158
|
+
context 'and the files specified manually' do
|
163
159
|
setup do
|
164
|
-
@gemspec
|
160
|
+
@gemspec = build_jeweler_gemspec do |gemspec|
|
165
161
|
gemspec.files = %w(Rakefile)
|
166
162
|
end
|
167
163
|
@gemspec.set_jeweler_defaults(@project, @project)
|
168
164
|
end
|
169
165
|
|
170
|
-
should
|
166
|
+
should 'not be overridden by files from git' do
|
171
167
|
assert_equal %w(Rakefile), @gemspec.files
|
172
168
|
end
|
173
169
|
end
|
174
|
-
|
175
170
|
end
|
176
171
|
|
177
|
-
context
|
172
|
+
context 'there are some files and is setup for git with ignored files' do
|
178
173
|
setup do
|
179
174
|
@project.file '.gitignore', 'ignored'
|
180
175
|
@project.file 'ignored'
|
@@ -189,17 +184,16 @@ class TestSpecification < Test::Unit::TestCase
|
|
189
184
|
repo.add('.')
|
190
185
|
repo.commit('Initial commit')
|
191
186
|
|
192
|
-
|
193
|
-
@gemspec = build_jeweler_gemspec
|
187
|
+
@gemspec = build_jeweler_gemspec
|
194
188
|
@gemspec.set_jeweler_defaults(@project, @project)
|
195
189
|
end
|
196
190
|
|
197
|
-
should
|
191
|
+
should 'populate files from git excluding ignored and .gitignore' do
|
198
192
|
assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
|
199
193
|
end
|
200
194
|
end
|
201
195
|
|
202
|
-
context
|
196
|
+
context 'there are some files and is setup for git and working in a sub directory' do
|
203
197
|
setup do
|
204
198
|
@subproject = File.join(@project, 'subproject')
|
205
199
|
@project.file 'Rakefile'
|
@@ -217,29 +211,28 @@ class TestSpecification < Test::Unit::TestCase
|
|
217
211
|
repo.add('.')
|
218
212
|
repo.commit('Initial commit')
|
219
213
|
|
220
|
-
@gemspec
|
214
|
+
@gemspec = build_jeweler_gemspec
|
221
215
|
@gemspec.set_jeweler_defaults(@subproject, @project)
|
222
216
|
end
|
223
217
|
|
224
|
-
should
|
218
|
+
should 'populate files from git relative to sub directory' do
|
225
219
|
assert_equal %w(lib/subproject_example.rb README).sort, @gemspec.files.sort
|
226
220
|
end
|
227
221
|
end
|
228
222
|
|
229
|
-
context
|
223
|
+
context 'there are some files and is not setup for git' do
|
230
224
|
setup do
|
231
225
|
@project.file 'Rakefile'
|
232
226
|
@project.directory('lib') do |lib|
|
233
227
|
lib.file 'example.rb'
|
234
228
|
end
|
235
229
|
|
236
|
-
@gemspec
|
230
|
+
@gemspec = build_jeweler_gemspec
|
237
231
|
@gemspec.set_jeweler_defaults(@project, @project)
|
238
232
|
end
|
239
233
|
|
240
|
-
should
|
234
|
+
should 'not populate files' do
|
241
235
|
assert_equal [], @gemspec.files.sort
|
242
236
|
end
|
243
237
|
end
|
244
|
-
|
245
238
|
end
|