jeweler 1.8.2 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.semver +5 -0
  4. data/.travis.yml +5 -3
  5. data/ChangeLog.markdown +30 -0
  6. data/Gemfile +32 -25
  7. data/Gemfile.lock +117 -46
  8. data/README.markdown +36 -10
  9. data/README.org +374 -0
  10. data/Rakefile +23 -28
  11. data/bin/jeweler +1 -0
  12. data/features/generator/gemfile.feature +1 -0
  13. data/features/generator/test.feature +2 -2
  14. data/features/step_definitions/debug_steps.rb +0 -1
  15. data/features/step_definitions/filesystem_steps.rb +2 -3
  16. data/features/step_definitions/generator_steps.rb +44 -66
  17. data/features/step_definitions/task_steps.rb +1 -2
  18. data/features/support/env.rb +22 -9
  19. data/jeweler.gemspec +64 -45
  20. data/lib/jeweler/commands/build_gem.rb +6 -2
  21. data/lib/jeweler/commands/check_dependencies.rb +3 -3
  22. data/lib/jeweler/commands/install_gem.rb +1 -1
  23. data/lib/jeweler/commands/release_gemspec.rb +17 -14
  24. data/lib/jeweler/commands/release_to_git.rb +20 -11
  25. data/lib/jeweler/commands/validate_gemspec.rb +5 -7
  26. data/lib/jeweler/commands/version/base.rb +8 -13
  27. data/lib/jeweler/commands/version/bump_major.rb +1 -3
  28. data/lib/jeweler/commands/version/bump_minor.rb +1 -2
  29. data/lib/jeweler/commands/version/bump_patch.rb +1 -4
  30. data/lib/jeweler/commands/write_gemspec.rb +4 -3
  31. data/lib/jeweler/commands.rb +6 -6
  32. data/lib/jeweler/gemspec_helper.rb +15 -15
  33. data/lib/jeweler/generator/application.rb +5 -10
  34. data/lib/jeweler/generator/bacon_mixin.rb +2 -4
  35. data/lib/jeweler/generator/github_mixin.rb +1 -10
  36. data/lib/jeweler/generator/micronaut_mixin.rb +3 -3
  37. data/lib/jeweler/generator/minitest_mixin.rb +2 -3
  38. data/lib/jeweler/generator/options.rb +16 -25
  39. data/lib/jeweler/generator/rdoc_mixin.rb +1 -1
  40. data/lib/jeweler/generator/riot_mixin.rb +2 -3
  41. data/lib/jeweler/generator/rspec_mixin.rb +2 -3
  42. data/lib/jeweler/generator/shindo_mixin.rb +2 -3
  43. data/lib/jeweler/generator/shoulda_mixin.rb +2 -3
  44. data/lib/jeweler/generator/testspec_mixin.rb +2 -3
  45. data/lib/jeweler/generator/testunit_mixin.rb +1 -3
  46. data/lib/jeweler/generator/yard_mixin.rb +3 -4
  47. data/lib/jeweler/generator.rb +52 -45
  48. data/lib/jeweler/rubyforge_tasks.rb +13 -13
  49. data/lib/jeweler/rubygems_dot_org_tasks.rb +3 -3
  50. data/lib/jeweler/rubygems_tasks.rb +3 -3
  51. data/lib/jeweler/specification.rb +22 -11
  52. data/lib/jeweler/tasks.rb +68 -59
  53. data/lib/jeweler/templates/Gemfile +1 -1
  54. data/lib/jeweler/templates/bacon/flunking.rb +3 -3
  55. data/lib/jeweler/templates/bacon/helper.rb +1 -0
  56. data/lib/jeweler/templates/features/support/env.rb +1 -0
  57. data/lib/jeweler/templates/jeweler_tasks.erb +1 -1
  58. data/lib/jeweler/templates/micronaut/flunking.rb +3 -3
  59. data/lib/jeweler/templates/micronaut/helper.rb +1 -0
  60. data/lib/jeweler/templates/minitest/flunking.rb +1 -1
  61. data/lib/jeweler/templates/minitest/helper.rb +4 -3
  62. data/lib/jeweler/templates/other_tasks.erb +4 -20
  63. data/lib/jeweler/templates/riot/flunking.rb +1 -1
  64. data/lib/jeweler/templates/riot/helper.rb +1 -0
  65. data/lib/jeweler/templates/rspec/flunking.rb +3 -3
  66. data/lib/jeweler/templates/rspec/helper.rb +3 -1
  67. data/lib/jeweler/templates/shindo/flunking.rb +3 -3
  68. data/lib/jeweler/templates/shindo/helper.rb +1 -0
  69. data/lib/jeweler/templates/shoulda/helper.rb +1 -0
  70. data/lib/jeweler/templates/simplecov.erb +16 -0
  71. data/lib/jeweler/templates/testspec/flunking.rb +3 -3
  72. data/lib/jeweler/templates/testspec/helper.rb +1 -1
  73. data/lib/jeweler/templates/testunit/helper.rb +1 -0
  74. data/lib/jeweler/version.rb +3 -3
  75. data/lib/jeweler/version_helper.rb +18 -15
  76. data/lib/jeweler.rb +23 -23
  77. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -1
  78. data/test/fixtures/existing-project-with-version-constant/Rakefile +18 -20
  79. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +15 -17
  80. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +2 -2
  81. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +17 -19
  82. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +15 -17
  83. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +2 -2
  84. data/test/fixtures/existing-project-with-version-yaml/Rakefile +17 -19
  85. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +15 -17
  86. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +2 -2
  87. data/test/jeweler/commands/test_build_gem.rb +33 -27
  88. data/test/jeweler/commands/test_install_gem.rb +7 -7
  89. data/test/jeweler/commands/test_release_to_gemcutter.rb +6 -7
  90. data/test/jeweler/commands/test_release_to_git.rb +95 -37
  91. data/test/jeweler/commands/test_release_to_github.rb +161 -97
  92. data/test/jeweler/commands/test_validate_gemspec.rb +4 -6
  93. data/test/jeweler/commands/test_write_gemspec.rb +21 -24
  94. data/test/jeweler/commands/version/test_base.rb +26 -6
  95. data/test/jeweler/commands/version/test_bump_major.rb +1 -5
  96. data/test/jeweler/commands/version/test_bump_minor.rb +1 -2
  97. data/test/jeweler/commands/version/test_bump_patch.rb +1 -3
  98. data/test/jeweler/commands/version/test_write.rb +1 -3
  99. data/test/jeweler/generator/test_application.rb +22 -26
  100. data/test/jeweler/generator/test_options.rb +26 -38
  101. data/test/jeweler/test_gemspec_helper.rb +7 -7
  102. data/test/jeweler/test_generator.rb +31 -33
  103. data/test/jeweler/test_generator_initialization.rb +40 -57
  104. data/test/jeweler/test_generator_mixins.rb +6 -7
  105. data/test/jeweler/test_specification.rb +44 -43
  106. data/test/jeweler/test_tasks.rb +2 -3
  107. data/test/jeweler/test_version_helper.rb +33 -35
  108. data/test/shoulda_macros/jeweler_macros.rb +5 -5
  109. data/test/test_helper.rb +25 -31
  110. data/test/test_jeweler.rb +28 -29
  111. metadata +206 -165
@@ -5,102 +5,88 @@ class TestGeneratorInitialization < Test::Unit::TestCase
5
5
  set_default_git_config
6
6
  end
7
7
 
8
- context "given a nil github repo name" do
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(:project_name => @project_name, :testing_framework => :shoulda, :documentation_framework => :rdoc)
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(:project_name => @project_name, :user_name => @git_name, :testing_framework => :shoulda, :documentation_framework => :rdoc)
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 "without github username set" do
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(:project_name => @project_name, :user_name => @git_name, :user_email => @git_email, :testing_framework => :shoulda, :documentation_framework => :rdoc)
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
-
56
- context "without github token set" do
57
- setup do
58
- stub_git_config
59
- end
60
-
61
- should 'raise NoGitHubToken if creating repo' do
62
- assert_raise Jeweler::NoGitHubToken do
63
- Jeweler::Generator.new(:project_name => @project_name, :user_name => @git_name, :user_email => @git_email, :github_username => @github_user, :create_repo => true, :testing_framework => :shoulda, :documentation_framework => :rdoc)
64
- end
65
- end
66
- end
67
-
68
55
  def build_generator(options = {})
69
- defaults = { :project_name => @project_name,
70
- :user_name => @git_name,
71
- :user_email => @git_email,
72
- :github_username => @github_user,
73
- :github_token => @github_token,
74
- :testing_framework => :shoulda,
75
- :documentation_framework => :rdoc }
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 }
76
62
 
77
63
  options = defaults.merge(options)
78
- Jeweler::Generator.new(options)
64
+ Jeweler::Generator.new(options)
79
65
  end
80
66
 
81
- context "default configuration" do
67
+ context 'default configuration' do
82
68
  setup do
83
69
  stub_git_config
84
70
  @generator = build_generator
85
71
  end
86
72
 
87
- should "use shoulda for testing" do
73
+ should 'use shoulda for testing' do
88
74
  assert_equal :shoulda, @generator.testing_framework
89
75
  end
90
76
 
91
- should "use rdoc for documentation" do
77
+ should 'use rdoc for documentation' do
92
78
  assert_equal :rdoc, @generator.documentation_framework
93
79
  end
94
80
 
95
- should "set todo in summary" do
96
- assert_match /todo/i, @generator.summary
81
+ should 'set todo in summary' do
82
+ assert_match(/todo/i, @generator.summary)
97
83
  end
98
84
 
99
- should "set todo in description" do
100
- assert_match /todo/i, @generator.description
85
+ should 'set todo in description' do
86
+ assert_match(/todo/i, @generator.description)
101
87
  end
102
88
 
103
- should "set target directory to the project name" do
89
+ should 'set target directory to the project name' do
104
90
  assert_equal @project_name, File.split(@generator.target_dir).last
105
91
  end
106
92
 
@@ -108,57 +94,54 @@ class TestGeneratorInitialization < Test::Unit::TestCase
108
94
  assert_equal @git_name, @generator.user_name
109
95
  end
110
96
 
111
- should "set email from git config" do
97
+ should 'set email from git config' do
112
98
  assert_equal @git_email, @generator.user_email
113
99
  end
114
100
 
115
- should "set origin remote as github, based on username and project name" do
101
+ should 'set origin remote as github, based on username and project name' do
116
102
  assert_equal "git@github.com:#{@github_user}/#{@project_name}.git", @generator.git_remote
117
103
  end
118
104
 
119
- should "set homepage as github based on username and project name" do
105
+ should 'set homepage as github based on username and project name' do
120
106
  assert_equal "http://github.com/#{@github_user}/#{@project_name}", @generator.homepage
121
107
  end
122
108
 
123
- should "set github username from git config" do
109
+ should 'set github username from git config' do
124
110
  assert_equal @github_user, @generator.github_username
125
111
  end
126
112
 
127
- should "set project name as the-perfect-gem" do
113
+ should 'set project name as the-perfect-gem' do
128
114
  assert_equal @project_name, @generator.project_name
129
115
  end
130
116
  end
131
117
 
132
- context "using yard" do
118
+ context 'using yard' do
133
119
  setup do
134
- @generator = build_generator(:documentation_framework => :yard)
120
+ @generator = build_generator(documentation_framework: :yard)
135
121
  end
136
122
 
137
- should "set the doc_task to yardoc" do
138
- assert_equal "yardoc", @generator.doc_task
123
+ should 'set the doc_task to yardoc' do
124
+ assert_equal 'yardoc', @generator.doc_task
139
125
  end
140
-
141
126
  end
142
127
 
143
- context "using rdoc" do
128
+ context 'using rdoc' do
144
129
  setup do
145
- @generator = build_generator(:documentation_framework => :rdoc)
130
+ @generator = build_generator(documentation_framework: :rdoc)
146
131
  end
147
132
 
148
- should "set the doc_task to rdoc" do
149
- assert_equal "rdoc", @generator.doc_task
133
+ should 'set the doc_task to rdoc' do
134
+ assert_equal 'rdoc', @generator.doc_task
150
135
  end
151
136
  end
152
137
 
153
- context "using a custom homepage" do
138
+ context 'using a custom homepage' do
154
139
  setup do
155
- @generator = build_generator(:homepage => 'http://zomg.com')
140
+ @generator = build_generator(homepage: 'http://zomg.com')
156
141
  end
157
142
 
158
- should "set the homepage" do
159
- assert_equal "http://zomg.com", @generator.homepage
143
+ should 'set the homepage' do
144
+ assert_equal 'http://zomg.com', @generator.homepage
160
145
  end
161
-
162
146
  end
163
-
164
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 "#{mixin}" do
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
- should "define #{method}" do
18
- assert mixin.method_defined?(method)
19
- end
20
- end
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 "be able to use to_ruby on a duped gemspec without error" do
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 "basic defaults" do
29
+ context 'basic defaults' do
30
30
  setup do
31
31
  @gemspec = build_jeweler_gemspec
32
32
  end
33
33
 
34
- should "make files a FileList" do
34
+ should 'make files a FileList' do
35
35
  assert_equal FileList, @gemspec.files.class
36
36
  end
37
37
 
38
- should "make extra_rdoc_files a FileList" do
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,61 +51,62 @@ 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 "and has been previously set executables" do
59
+ context 'and has been previously set executables' do
62
60
  setup do
63
- @gemspec = build_jeweler_gemspec do |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 "have only the original executables in the gemspec" do
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 "there are multiple executables in the project directory" do
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'
79
77
  bin.file 'trogdor'
80
78
  end
81
79
  repo = Git.init(@project.to_s)
80
+ repo.config('user.name', 'who')
81
+ repo.config('user.email', 'who@where.com')
82
82
  repo.add('bin/burnination')
83
83
  repo.commit('Initial commit')
84
84
  end
85
85
 
86
86
  context "and there hasn't been any set on the gemspec" do
87
87
  setup do
88
- @gemspec = build_jeweler_gemspec
88
+ @gemspec = build_jeweler_gemspec
89
89
  @gemspec.set_jeweler_defaults(@project)
90
90
  end
91
91
 
92
- should "have the executables under version control in the gemspec" do
92
+ should 'have the executables under version control in the gemspec' do
93
93
  assert_equal %w(burnination), @gemspec.executables
94
94
  end
95
95
  end
96
- context "and has been previously set executables" do
96
+ context 'and has been previously set executables' do
97
97
  setup do
98
- @gemspec = build_jeweler_gemspec do |gemspec|
98
+ @gemspec = build_jeweler_gemspec do |gemspec|
99
99
  gemspec.executables = %w(burnination)
100
100
  end
101
101
  @gemspec.set_jeweler_defaults(@project)
102
102
  end
103
- should "have only the original executables in the gemspec" do
103
+ should 'have only the original executables in the gemspec' do
104
104
  assert_equal %w(burnination), @gemspec.executables
105
105
  end
106
106
  end
107
107
  end
108
108
 
109
- context "there are mutiple extconf.rb and mkrf_conf.rb in the project directory" do
109
+ context 'there are mutiple extconf.rb and mkrf_conf.rb in the project directory' do
110
110
  setup do
111
111
  @project.directory('ext') do |ext|
112
112
  ext.file 'extconf.rb'
@@ -120,19 +120,17 @@ class TestSpecification < Test::Unit::TestCase
120
120
 
121
121
  context "and there hasn't been any extensions set on the gemspec" do
122
122
  setup do
123
- @gemspec = build_jeweler_gemspec
123
+ @gemspec = build_jeweler_gemspec
124
124
  @gemspec.set_jeweler_defaults(@project)
125
125
  end
126
126
 
127
- should "have all the extconf.rb and mkrf_config.rb files in extensions" do
127
+ should 'have all the extconf.rb and mkrf_config.rb files in extensions' do
128
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
129
129
  end
130
-
131
130
  end
132
-
133
131
  end
134
132
 
135
- context "there are some files and is setup for git" do
133
+ context 'there are some files and is setup for git' do
136
134
  setup do
137
135
  @project.file 'Rakefile'
138
136
  @project.directory('lib') do |lib|
@@ -140,37 +138,38 @@ class TestSpecification < Test::Unit::TestCase
140
138
  end
141
139
 
142
140
  repo = Git.init(@project.to_s)
141
+ repo.config('user.name', 'who')
142
+ repo.config('user.email', 'who@where.com')
143
143
  repo.add('.')
144
144
  repo.commit('Initial commit')
145
145
  end
146
146
 
147
- context "and the files defaults are used" do
147
+ context 'and the files defaults are used' do
148
148
  setup do
149
- @gemspec = build_jeweler_gemspec
149
+ @gemspec = build_jeweler_gemspec
150
150
  @gemspec.set_jeweler_defaults(@project, @project)
151
151
  end
152
152
 
153
- should "populate files from git" do
153
+ should 'populate files from git' do
154
154
  assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
155
155
  end
156
156
  end
157
157
 
158
- context "and the files specified manually" do
158
+ context 'and the files specified manually' do
159
159
  setup do
160
- @gemspec = build_jeweler_gemspec do |gemspec|
160
+ @gemspec = build_jeweler_gemspec do |gemspec|
161
161
  gemspec.files = %w(Rakefile)
162
162
  end
163
163
  @gemspec.set_jeweler_defaults(@project, @project)
164
164
  end
165
165
 
166
- should "not be overridden by files from git" do
166
+ should 'not be overridden by files from git' do
167
167
  assert_equal %w(Rakefile), @gemspec.files
168
168
  end
169
169
  end
170
-
171
170
  end
172
171
 
173
- context "there are some files and is setup for git with ignored files" do
172
+ context 'there are some files and is setup for git with ignored files' do
174
173
  setup do
175
174
  @project.file '.gitignore', 'ignored'
176
175
  @project.file 'ignored'
@@ -180,20 +179,21 @@ class TestSpecification < Test::Unit::TestCase
180
179
  end
181
180
 
182
181
  repo = Git.init(@project.to_s)
182
+ repo.config('user.name', 'who')
183
+ repo.config('user.email', 'who@where.com')
183
184
  repo.add('.')
184
185
  repo.commit('Initial commit')
185
186
 
186
-
187
- @gemspec = build_jeweler_gemspec
187
+ @gemspec = build_jeweler_gemspec
188
188
  @gemspec.set_jeweler_defaults(@project, @project)
189
189
  end
190
190
 
191
- should "populate files from git excluding ignored and .gitignore" do
191
+ should 'populate files from git excluding ignored and .gitignore' do
192
192
  assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
193
193
  end
194
194
  end
195
195
 
196
- context "there are some files and is setup for git and working in a sub directory" do
196
+ context 'there are some files and is setup for git and working in a sub directory' do
197
197
  setup do
198
198
  @subproject = File.join(@project, 'subproject')
199
199
  @project.file 'Rakefile'
@@ -206,32 +206,33 @@ class TestSpecification < Test::Unit::TestCase
206
206
  end
207
207
 
208
208
  repo = Git.init(@project.to_s)
209
+ repo.config('user.name', 'who')
210
+ repo.config('user.email', 'who@where.com')
209
211
  repo.add('.')
210
212
  repo.commit('Initial commit')
211
213
 
212
- @gemspec = build_jeweler_gemspec
214
+ @gemspec = build_jeweler_gemspec
213
215
  @gemspec.set_jeweler_defaults(@subproject, @project)
214
216
  end
215
217
 
216
- should "populate files from git relative to sub directory" do
218
+ should 'populate files from git relative to sub directory' do
217
219
  assert_equal %w(lib/subproject_example.rb README).sort, @gemspec.files.sort
218
220
  end
219
221
  end
220
222
 
221
- context "there are some files and is not setup for git" do
223
+ context 'there are some files and is not setup for git' do
222
224
  setup do
223
225
  @project.file 'Rakefile'
224
226
  @project.directory('lib') do |lib|
225
227
  lib.file 'example.rb'
226
228
  end
227
229
 
228
- @gemspec = build_jeweler_gemspec
230
+ @gemspec = build_jeweler_gemspec
229
231
  @gemspec.set_jeweler_defaults(@project, @project)
230
232
  end
231
233
 
232
- should "not populate files" do
234
+ should 'not populate files' do
233
235
  assert_equal [], @gemspec.files.sort
234
236
  end
235
237
  end
236
-
237
238
  end
@@ -6,8 +6,8 @@ class TestTasks < Test::Unit::TestCase
6
6
 
7
7
  context 'instantiating Jeweler::Tasks' do
8
8
  setup do
9
- @gemspec_building_block = lambda {|gemspec|}
10
- @tasks = Jeweler::Tasks.new &@gemspec_building_block
9
+ @gemspec_building_block = ->(gemspec) {}
10
+ @tasks = Jeweler::Tasks.new(&@gemspec_building_block)
11
11
  end
12
12
 
13
13
  teardown do
@@ -45,6 +45,5 @@ class TestTasks < Test::Unit::TestCase
45
45
  @tasks = Jeweler::Tasks.new { |s| spec = s }
46
46
  assert_not_nil @tasks.jeweler.gemspec
47
47
  end
48
-
49
48
  end
50
49
  end