jeweler 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.semver +1 -1
  3. data/.travis.yml +5 -1
  4. data/ChangeLog.markdown +4 -0
  5. data/Gemfile +23 -23
  6. data/Gemfile.lock +142 -0
  7. data/Gemfile.orig +54 -0
  8. data/README.markdown +3 -0
  9. data/Rakefile +13 -14
  10. data/Rakefile.orig +88 -0
  11. data/features/generator/test.feature +2 -2
  12. data/features/step_definitions/debug_steps.rb +0 -1
  13. data/features/step_definitions/filesystem_steps.rb +2 -3
  14. data/features/step_definitions/generator_steps.rb +44 -64
  15. data/features/step_definitions/task_steps.rb +1 -2
  16. data/features/support/env.rb +21 -7
  17. data/jeweler.gemspec +11 -6
  18. data/jeweler.gemspec.orig +464 -0
  19. data/lib/jeweler.rb +18 -19
  20. data/lib/jeweler/commands/build_gem.rb +2 -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 +8 -10
  24. data/lib/jeweler/commands/release_to_git.rb +9 -5
  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/gemspec_helper.rb +15 -15
  32. data/lib/jeweler/gemspec_helper.rb.orig +91 -0
  33. data/lib/jeweler/generator.rb +39 -41
  34. data/lib/jeweler/generator/application.rb +5 -7
  35. data/lib/jeweler/generator/bacon_mixin.rb +2 -4
  36. data/lib/jeweler/generator/github_mixin.rb +1 -3
  37. data/lib/jeweler/generator/micronaut_mixin.rb +3 -3
  38. data/lib/jeweler/generator/minitest_mixin.rb +2 -3
  39. data/lib/jeweler/generator/options.rb +15 -19
  40. data/lib/jeweler/generator/rdoc_mixin.rb +1 -1
  41. data/lib/jeweler/generator/riot_mixin.rb +2 -3
  42. data/lib/jeweler/generator/rspec_mixin.rb +2 -3
  43. data/lib/jeweler/generator/shindo_mixin.rb +2 -3
  44. data/lib/jeweler/generator/shoulda_mixin.rb +2 -3
  45. data/lib/jeweler/generator/testspec_mixin.rb +2 -3
  46. data/lib/jeweler/generator/testunit_mixin.rb +1 -3
  47. data/lib/jeweler/generator/yard_mixin.rb +3 -4
  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 +57 -57
  53. data/lib/jeweler/templates/bacon/flunking.rb +3 -3
  54. data/lib/jeweler/templates/micronaut/flunking.rb +3 -3
  55. data/lib/jeweler/templates/minitest/flunking.rb +1 -1
  56. data/lib/jeweler/templates/minitest/helper.rb +3 -3
  57. data/lib/jeweler/templates/riot/flunking.rb +1 -1
  58. data/lib/jeweler/templates/rspec/flunking.rb +3 -3
  59. data/lib/jeweler/templates/shindo/flunking.rb +3 -3
  60. data/lib/jeweler/templates/testspec/flunking.rb +3 -3
  61. data/lib/jeweler/version_helper.rb +18 -15
  62. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -1
  63. data/test/fixtures/existing-project-with-version-constant/Rakefile +18 -20
  64. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +15 -17
  65. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +2 -2
  66. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +17 -19
  67. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +15 -17
  68. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +2 -2
  69. data/test/fixtures/existing-project-with-version-yaml/Rakefile +17 -19
  70. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +15 -17
  71. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +2 -2
  72. data/test/jeweler/commands/test_build_gem.rb +25 -28
  73. data/test/jeweler/commands/test_install_gem.rb +7 -7
  74. data/test/jeweler/commands/test_release_to_gemcutter.rb +6 -7
  75. data/test/jeweler/commands/test_release_to_git.rb +52 -57
  76. data/test/jeweler/commands/test_release_to_github.rb +112 -119
  77. data/test/jeweler/commands/test_validate_gemspec.rb +4 -6
  78. data/test/jeweler/commands/test_write_gemspec.rb +21 -24
  79. data/test/jeweler/commands/version/test_base.rb +9 -10
  80. data/test/jeweler/commands/version/test_bump_major.rb +1 -5
  81. data/test/jeweler/commands/version/test_bump_minor.rb +1 -2
  82. data/test/jeweler/commands/version/test_bump_patch.rb +1 -3
  83. data/test/jeweler/commands/version/test_write.rb +1 -3
  84. data/test/jeweler/generator/test_application.rb +22 -26
  85. data/test/jeweler/generator/test_options.rb +26 -27
  86. data/test/jeweler/test_gemspec_helper.rb +7 -7
  87. data/test/jeweler/test_generator.rb +31 -32
  88. data/test/jeweler/test_generator_initialization.rb +40 -43
  89. data/test/jeweler/test_generator_mixins.rb +6 -7
  90. data/test/jeweler/test_specification.rb +36 -43
  91. data/test/jeweler/test_tasks.rb +2 -3
  92. data/test/jeweler/test_version_helper.rb +33 -35
  93. data/test/shoulda_macros/jeweler_macros.rb +5 -5
  94. data/test/test_helper.rb +23 -25
  95. data/test/test_jeweler.rb +22 -25
  96. 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, "Rakefile")
5
+ Rake.application.instance_variable_set(:@rakefile, 'Rakefile')
6
6
  end
7
7
 
8
- context "given a gemspec" do
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 "#write" do
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 "create gemspec file" do
33
- assert File.exists?(@helper.path)
32
+ should 'create gemspec file' do
33
+ assert File.exist?(@helper.path)
34
34
  end
35
35
 
36
- should "make valid spec" do
36
+ should 'make valid spec' do
37
37
  assert @helper.valid?
38
38
  end
39
39
 
40
- should "parse" do
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
- :project_name => 'the-perfect-gem',
7
- :user_name => 'John Doe',
8
- :user_email => 'john@example.com',
9
- :github_username => 'johndoe',
10
- :documentation_framework => :rdoc
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 "have the correct constant name" do
18
- assert_equal "ThePerfectGem", build_generator.constant_name
17
+ should 'have the correct constant name' do
18
+ assert_equal 'ThePerfectGem', build_generator.constant_name
19
19
  end
20
20
 
21
- should "have the correct file name prefix" do
22
- assert_equal "the_perfect_gem", build_generator.file_name_prefix
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 "have the correct require name" do
26
- assert_equal "the-perfect-gem", build_generator.require_name
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 "have the correct lib file name" do
30
- assert_equal "the-perfect-gem.rb", build_generator.lib_filename
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 "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
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 "extract project name from absolut path" do
39
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "/tmp/my-project"}).project_name
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 "extract project name from relative path" do
43
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "../my-project"}).project_name
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 "extract project name from direct path" do
47
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "my-project"}).project_name
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 "shoulda" do
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 "testunit" do
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 "minitest" do
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 "bacon" do
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 "rspec" do
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 "micronaut" do
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 "testspec" do
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 "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
55
  def build_generator(options = {})
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 }
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 "default configuration" do
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 "use shoulda for testing" do
73
+ should 'use shoulda for testing' do
74
74
  assert_equal :shoulda, @generator.testing_framework
75
75
  end
76
76
 
77
- should "use rdoc for documentation" do
77
+ should 'use rdoc for documentation' do
78
78
  assert_equal :rdoc, @generator.documentation_framework
79
79
  end
80
80
 
81
- should "set todo in summary" do
82
- assert_match /todo/i, @generator.summary
81
+ should 'set todo in summary' do
82
+ assert_match(/todo/i, @generator.summary)
83
83
  end
84
84
 
85
- should "set todo in description" do
86
- assert_match /todo/i, @generator.description
85
+ should 'set todo in description' do
86
+ assert_match(/todo/i, @generator.description)
87
87
  end
88
88
 
89
- should "set target directory to the project name" do
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 "set email from git config" do
97
+ should 'set email from git config' do
98
98
  assert_equal @git_email, @generator.user_email
99
99
  end
100
100
 
101
- 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
102
102
  assert_equal "git@github.com:#{@github_user}/#{@project_name}.git", @generator.git_remote
103
103
  end
104
104
 
105
- 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
106
106
  assert_equal "http://github.com/#{@github_user}/#{@project_name}", @generator.homepage
107
107
  end
108
108
 
109
- should "set github username from git config" do
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 "set project name as the-perfect-gem" do
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 "using yard" do
118
+ context 'using yard' do
119
119
  setup do
120
- @generator = build_generator(:documentation_framework => :yard)
120
+ @generator = build_generator(documentation_framework: :yard)
121
121
  end
122
122
 
123
- should "set the doc_task to yardoc" do
124
- assert_equal "yardoc", @generator.doc_task
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 "using rdoc" do
128
+ context 'using rdoc' do
130
129
  setup do
131
- @generator = build_generator(:documentation_framework => :rdoc)
130
+ @generator = build_generator(documentation_framework: :rdoc)
132
131
  end
133
132
 
134
- should "set the doc_task to rdoc" do
135
- assert_equal "rdoc", @generator.doc_task
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 "using a custom homepage" do
138
+ context 'using a custom homepage' do
140
139
  setup do
141
- @generator = build_generator(:homepage => 'http://zomg.com')
140
+ @generator = build_generator(homepage: 'http://zomg.com')
142
141
  end
143
142
 
144
- should "set the homepage" do
145
- assert_equal "http://zomg.com", @generator.homepage
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 "#{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,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 "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'
@@ -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 = build_jeweler_gemspec
88
+ @gemspec = build_jeweler_gemspec
91
89
  @gemspec.set_jeweler_defaults(@project)
92
90
  end
93
91
 
94
- should "have the executables under version control in the gemspec" do
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 "and has been previously set executables" do
96
+ context 'and has been previously set executables' do
99
97
  setup do
100
- @gemspec = build_jeweler_gemspec do |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 "have only the original executables in the gemspec" do
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 "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
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 = build_jeweler_gemspec
123
+ @gemspec = build_jeweler_gemspec
126
124
  @gemspec.set_jeweler_defaults(@project)
127
125
  end
128
126
 
129
- 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
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 "there are some files and is setup for git" do
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 "and the files defaults are used" do
147
+ context 'and the files defaults are used' do
152
148
  setup do
153
- @gemspec = build_jeweler_gemspec
149
+ @gemspec = build_jeweler_gemspec
154
150
  @gemspec.set_jeweler_defaults(@project, @project)
155
151
  end
156
152
 
157
- should "populate files from git" do
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 "and the files specified manually" do
158
+ context 'and the files specified manually' do
163
159
  setup do
164
- @gemspec = build_jeweler_gemspec do |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 "not be overridden by files from git" do
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 "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
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 "populate files from git excluding ignored and .gitignore" do
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 "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
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 = build_jeweler_gemspec
214
+ @gemspec = build_jeweler_gemspec
221
215
  @gemspec.set_jeweler_defaults(@subproject, @project)
222
216
  end
223
217
 
224
- should "populate files from git relative to sub directory" do
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 "there are some files and is not setup for git" do
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 = build_jeweler_gemspec
230
+ @gemspec = build_jeweler_gemspec
237
231
  @gemspec.set_jeweler_defaults(@project, @project)
238
232
  end
239
233
 
240
- should "not populate files" do
234
+ should 'not populate files' do
241
235
  assert_equal [], @gemspec.files.sort
242
236
  end
243
237
  end
244
-
245
238
  end