jeweler2 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/lib/jeweler/version.rb +1 -1
  2. metadata +30 -145
  3. data/.document +0 -8
  4. data/Gemfile +0 -18
  5. data/Gemfile.lock +0 -47
  6. data/Rakefile +0 -80
  7. data/features/generator/cucumber.feature +0 -103
  8. data/features/generator/directory_layout.feature +0 -86
  9. data/features/generator/dotdocument.feature +0 -13
  10. data/features/generator/env_options.feature +0 -9
  11. data/features/generator/gemfile.feature +0 -71
  12. data/features/generator/git.feature +0 -102
  13. data/features/generator/license.feature +0 -20
  14. data/features/generator/rakefile.feature +0 -158
  15. data/features/generator/readme.feature +0 -12
  16. data/features/generator/test.feature +0 -54
  17. data/features/generator/test_helper.feature +0 -149
  18. data/features/placeholder.feature +0 -5
  19. data/features/step_definitions/debug_steps.rb +0 -6
  20. data/features/step_definitions/filesystem_steps.rb +0 -70
  21. data/features/step_definitions/generator_steps.rb +0 -380
  22. data/features/step_definitions/task_steps.rb +0 -6
  23. data/features/support/env.rb +0 -42
  24. data/features/tasks/build_gem.feature +0 -9
  25. data/features/tasks/version.feature +0 -31
  26. data/features/tasks/version_bumping.feature +0 -49
  27. data/jeweler.gemspec +0 -245
  28. data/jeweler2.gemspec +0 -233
  29. data/lib/jeweler/templates/.document +0 -5
  30. data/lib/jeweler/templates/.gitignore +0 -48
  31. data/lib/jeweler/templates/Gemfile +0 -12
  32. data/lib/jeweler/templates/LICENSE.txt +0 -20
  33. data/lib/jeweler/templates/README.rdoc +0 -19
  34. data/lib/jeweler/templates/Rakefile +0 -9
  35. data/lib/jeweler/templates/bacon/flunking.rb +0 -7
  36. data/lib/jeweler/templates/bacon/helper.rb +0 -9
  37. data/lib/jeweler/templates/bundler_setup.erb +0 -10
  38. data/lib/jeweler/templates/features/default.feature +0 -9
  39. data/lib/jeweler/templates/features/support/env.rb +0 -10
  40. data/lib/jeweler/templates/jeweler_tasks.erb +0 -31
  41. data/lib/jeweler/templates/micronaut/flunking.rb +0 -7
  42. data/lib/jeweler/templates/micronaut/helper.rb +0 -18
  43. data/lib/jeweler/templates/minitest/flunking.rb +0 -7
  44. data/lib/jeweler/templates/minitest/helper.rb +0 -12
  45. data/lib/jeweler/templates/other_tasks.erb +0 -86
  46. data/lib/jeweler/templates/riot/flunking.rb +0 -11
  47. data/lib/jeweler/templates/riot/helper.rb +0 -4
  48. data/lib/jeweler/templates/rspec/.rspec +0 -1
  49. data/lib/jeweler/templates/rspec/flunking.rb +0 -7
  50. data/lib/jeweler/templates/rspec/helper.rb +0 -12
  51. data/lib/jeweler/templates/shindo/flunking.rb +0 -8
  52. data/lib/jeweler/templates/shindo/helper.rb +0 -6
  53. data/lib/jeweler/templates/shoulda/flunking.rb +0 -7
  54. data/lib/jeweler/templates/shoulda/helper.rb +0 -11
  55. data/lib/jeweler/templates/testspec/flunking.rb +0 -7
  56. data/lib/jeweler/templates/testspec/helper.rb +0 -7
  57. data/lib/jeweler/templates/testunit/flunking.rb +0 -7
  58. data/lib/jeweler/templates/testunit/helper.rb +0 -10
  59. data/test/fixtures/bar/VERSION.yml +0 -4
  60. data/test/fixtures/bar/bin/foo_the_ultimate_bin +0 -1
  61. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  62. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +0 -1
  63. data/test/fixtures/existing-project-with-version-constant/.document +0 -5
  64. data/test/fixtures/existing-project-with-version-constant/.gitignore +0 -5
  65. data/test/fixtures/existing-project-with-version-constant/LICENSE.txt +0 -20
  66. data/test/fixtures/existing-project-with-version-constant/README.rdoc +0 -7
  67. data/test/fixtures/existing-project-with-version-constant/Rakefile +0 -85
  68. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +0 -29
  69. data/test/fixtures/existing-project-with-version-constant/lib/existing_project_with_version.rb +0 -0
  70. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +0 -7
  71. data/test/fixtures/existing-project-with-version-constant/test/test_helper.rb +0 -10
  72. data/test/fixtures/existing-project-with-version-plaintext/.document +0 -5
  73. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +0 -5
  74. data/test/fixtures/existing-project-with-version-plaintext/LICENSE.txt +0 -20
  75. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +0 -7
  76. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +0 -84
  77. data/test/fixtures/existing-project-with-version-plaintext/VERSION +0 -1
  78. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +0 -29
  79. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  80. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +0 -7
  81. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +0 -10
  82. data/test/fixtures/existing-project-with-version-yaml/.document +0 -5
  83. data/test/fixtures/existing-project-with-version-yaml/.gitignore +0 -5
  84. data/test/fixtures/existing-project-with-version-yaml/LICENSE.txt +0 -20
  85. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +0 -7
  86. data/test/fixtures/existing-project-with-version-yaml/Rakefile +0 -84
  87. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +0 -4
  88. data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +0 -0
  89. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +0 -29
  90. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  91. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +0 -7
  92. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +0 -10
  93. data/test/geminstaller.yml +0 -12
  94. data/test/jeweler/commands/test_build_gem.rb +0 -103
  95. data/test/jeweler/commands/test_install_gem.rb +0 -35
  96. data/test/jeweler/commands/test_release_to_gemcutter.rb +0 -39
  97. data/test/jeweler/commands/test_release_to_git.rb +0 -198
  98. data/test/jeweler/commands/test_release_to_github.rb +0 -390
  99. data/test/jeweler/commands/test_validate_gemspec.rb +0 -27
  100. data/test/jeweler/commands/test_write_gemspec.rb +0 -101
  101. data/test/jeweler/commands/version/test_base.rb +0 -32
  102. data/test/jeweler/commands/version/test_bump_major.rb +0 -22
  103. data/test/jeweler/commands/version/test_bump_minor.rb +0 -19
  104. data/test/jeweler/commands/version/test_bump_patch.rb +0 -20
  105. data/test/jeweler/commands/version/test_write.rb +0 -22
  106. data/test/jeweler/generator/test_application.rb +0 -120
  107. data/test/jeweler/generator/test_options.rb +0 -225
  108. data/test/jeweler/test_gemspec_helper.rb +0 -44
  109. data/test/jeweler/test_generator.rb +0 -141
  110. data/test/jeweler/test_generator_initialization.rb +0 -164
  111. data/test/jeweler/test_generator_mixins.rb +0 -23
  112. data/test/jeweler/test_specification.rb +0 -237
  113. data/test/jeweler/test_tasks.rb +0 -50
  114. data/test/jeweler/test_version_helper.rb +0 -214
  115. data/test/shoulda_macros/jeweler_macros.rb +0 -35
  116. data/test/test_helper.rb +0 -178
  117. data/test/test_jeweler.rb +0 -175
@@ -1,44 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestGemspecHelper < Test::Unit::TestCase
4
- def setup
5
- Rake.application.instance_variable_set(:@rakefile, "Rakefile")
6
- end
7
-
8
- context "given a gemspec" do
9
- setup do
10
- @spec = build_spec
11
- @helper = Jeweler::GemSpecHelper.new(@spec, File.dirname(__FILE__))
12
- end
13
-
14
- should 'have sane gemspec path' do
15
- assert_equal "test/jeweler/#{@spec.name}.gemspec", @helper.path
16
- end
17
- end
18
-
19
- context "#write" do
20
- setup do
21
- @spec = build_spec
22
- @helper = Jeweler::GemSpecHelper.new(@spec, File.dirname(__FILE__))
23
- FileUtils.rm_f(@helper.path)
24
-
25
- @helper.write
26
- end
27
-
28
- teardown do
29
- FileUtils.rm_f(@helper.path)
30
- end
31
-
32
- should "create gemspec file" do
33
- assert File.exists?(@helper.path)
34
- end
35
-
36
- should "make valid spec" do
37
- assert @helper.valid?
38
- end
39
-
40
- should "parse" do
41
- @helper.parse
42
- end
43
- end
44
- end
@@ -1,141 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestGenerator < Test::Unit::TestCase
4
- def build_generator(testing_framework = :shoulda, options = {})
5
- options = {
6
- :project_name => 'the-perfect-gem',
7
- :user_name => 'John Doe',
8
- :user_email => 'john@example.com',
9
- :github_username => 'johndoe',
10
- :github_token => 'yyz',
11
- :documentation_framework => :rdoc
12
- }.merge(options)
13
-
14
- options[:testing_framework] = testing_framework
15
- Jeweler::Generator.new(options)
16
- end
17
-
18
- should "have the correct constant name" do
19
- assert_equal "ThePerfectGem", build_generator.constant_name
20
- end
21
-
22
- should "have the correct file name prefix" do
23
- assert_equal "the_perfect_gem", build_generator.file_name_prefix
24
- end
25
-
26
- should "have the correct require name" do
27
- assert_equal "the-perfect-gem", build_generator.require_name
28
- end
29
-
30
- should "have the correct lib file name" do
31
- assert_equal "the-perfect-gem.rb", build_generator.lib_filename
32
- end
33
-
34
- should "have the correct git-remote" do
35
- assert_equal 'user@host:/path/to/repo', build_generator(:shoulda, {:git_remote => "user@host:/path/to/repo"}).git_remote
36
- assert_equal 'git@github.com:johndoe/the-perfect-gem.git', build_generator.git_remote
37
- end
38
-
39
- should "extract project name from absolut path" do
40
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "/tmp/my-project"}).project_name
41
- end
42
-
43
- should "extract project name from relative path" do
44
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "../my-project"}).project_name
45
- end
46
-
47
- should "extract project name from direct path" do
48
- assert_equal "my-project", build_generator(:shoulda, {:project_name => "my-project"}).project_name
49
- end
50
-
51
- def self.should_have_generator_attribute(attribute, value)
52
- should "have #{value} for #{attribute}" do
53
- assert_equal value, build_generator(@framework).send(attribute)
54
- end
55
- end
56
-
57
- context "shoulda" do
58
- setup { @framework = :shoulda }
59
- should_have_generator_attribute :test_task, 'test'
60
- should_have_generator_attribute :test_dir, 'test'
61
- should_have_generator_attribute :default_task, 'test'
62
- should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
63
- should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
64
- should_have_generator_attribute :test_pattern, 'test/**/test_*.rb'
65
- should_have_generator_attribute :test_filename, 'test_the-perfect-gem.rb'
66
- should_have_generator_attribute :test_helper_filename, 'helper.rb'
67
- end
68
-
69
- context "testunit" do
70
- setup { @framework = :testunit }
71
- should_have_generator_attribute :test_task, 'test'
72
- should_have_generator_attribute :test_dir, 'test'
73
- should_have_generator_attribute :default_task, 'test'
74
- should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
75
- should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
76
- should_have_generator_attribute :test_pattern, 'test/**/test_*.rb'
77
- should_have_generator_attribute :test_filename, 'test_the-perfect-gem.rb'
78
- should_have_generator_attribute :test_helper_filename, 'helper.rb'
79
- end
80
-
81
- context "minitest" do
82
- setup { @framework = :minitest }
83
- should_have_generator_attribute :test_task, 'test'
84
- should_have_generator_attribute :test_dir, 'test'
85
- should_have_generator_attribute :default_task, 'test'
86
- should_have_generator_attribute :feature_support_require, 'minitest/unit'
87
- should_have_generator_attribute :feature_support_extend, 'MiniTest::Assertions'
88
- should_have_generator_attribute :test_pattern, 'test/**/test_*.rb'
89
- should_have_generator_attribute :test_filename, 'test_the-perfect-gem.rb'
90
- should_have_generator_attribute :test_helper_filename, 'helper.rb'
91
- end
92
-
93
- context "bacon" do
94
- setup { @framework = :bacon }
95
- should_have_generator_attribute :test_task, 'spec'
96
- should_have_generator_attribute :test_dir, 'spec'
97
- should_have_generator_attribute :default_task, 'spec'
98
- should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
99
- should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
100
- should_have_generator_attribute :test_pattern, 'spec/**/*_spec.rb'
101
- should_have_generator_attribute :test_filename, 'the-perfect-gem_spec.rb'
102
- should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
103
- end
104
-
105
- context "rspec" do
106
- setup { @framework = :rspec }
107
- should_have_generator_attribute :test_task, 'spec'
108
- should_have_generator_attribute :test_dir, 'spec'
109
- should_have_generator_attribute :default_task, 'spec'
110
- should_have_generator_attribute :feature_support_require, 'rspec/expectations'
111
- should_have_generator_attribute :feature_support_extend, nil
112
- should_have_generator_attribute :test_pattern, 'spec/**/*_spec.rb'
113
- should_have_generator_attribute :test_filename, 'the-perfect-gem_spec.rb'
114
- should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
115
- end
116
-
117
- context "micronaut" do
118
- setup { @framework = :micronaut }
119
- should_have_generator_attribute :test_task, 'examples'
120
- should_have_generator_attribute :test_dir, 'examples'
121
- should_have_generator_attribute :default_task, 'examples'
122
- should_have_generator_attribute :feature_support_require, 'micronaut/expectations'
123
- should_have_generator_attribute :feature_support_extend, 'Micronaut::Matchers'
124
- should_have_generator_attribute :test_pattern, 'examples/**/*_example.rb'
125
- should_have_generator_attribute :test_filename, 'the-perfect-gem_example.rb'
126
- should_have_generator_attribute :test_helper_filename, 'example_helper.rb'
127
- end
128
-
129
- context "testspec" do
130
- setup { @framework = :testspec }
131
- should_have_generator_attribute :test_task, 'test'
132
- should_have_generator_attribute :test_dir, 'test'
133
- should_have_generator_attribute :default_task, 'test'
134
- should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
135
- should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
136
- should_have_generator_attribute :test_pattern, 'test/**/*_test.rb'
137
- should_have_generator_attribute :test_filename, 'the-perfect-gem_test.rb'
138
- should_have_generator_attribute :test_helper_filename, 'test_helper.rb'
139
- end
140
-
141
- end
@@ -1,164 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestGeneratorInitialization < Test::Unit::TestCase
4
- def setup
5
- set_default_git_config
6
- end
7
-
8
- context "given a nil github repo name" do
9
- setup do
10
- stub_git_config
11
- end
12
-
13
- should 'raise NoGithubRepoNameGiven' do
14
- assert_raise Jeweler::NoGitHubRepoNameGiven do
15
- Jeweler::Generator.new()
16
- end
17
- end
18
- end
19
-
20
- context "without git user's name set" do
21
- setup do
22
- stub_git_config
23
- end
24
-
25
- should 'raise an NoGitUserName' do
26
- assert_raise Jeweler::NoGitUserName do
27
- Jeweler::Generator.new(:project_name => @project_name, :testing_framework => :shoulda, :documentation_framework => :rdoc)
28
- end
29
- end
30
- end
31
-
32
- context "without git user's email set" do
33
- setup do
34
- stub_git_config
35
- end
36
-
37
- should 'raise NoGitUserEmail' do
38
- assert_raise Jeweler::NoGitUserEmail do
39
- Jeweler::Generator.new(:project_name => @project_name, :user_name => @git_name, :testing_framework => :shoulda, :documentation_framework => :rdoc)
40
- end
41
- end
42
- end
43
-
44
- context "without github username set" do
45
- setup do
46
- stub_git_config
47
- end
48
-
49
- should 'raise NotGitHubUser' do
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)
52
- end
53
- end
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
- 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 }
76
-
77
- options = defaults.merge(options)
78
- Jeweler::Generator.new(options)
79
- end
80
-
81
- context "default configuration" do
82
- setup do
83
- stub_git_config
84
- @generator = build_generator
85
- end
86
-
87
- should "use shoulda for testing" do
88
- assert_equal :shoulda, @generator.testing_framework
89
- end
90
-
91
- should "use rdoc for documentation" do
92
- assert_equal :rdoc, @generator.documentation_framework
93
- end
94
-
95
- should "set todo in summary" do
96
- assert_match /todo/i, @generator.summary
97
- end
98
-
99
- should "set todo in description" do
100
- assert_match /todo/i, @generator.description
101
- end
102
-
103
- should "set target directory to the project name" do
104
- assert_equal @project_name, File.split(@generator.target_dir).last
105
- end
106
-
107
- should "set user's name from git config" do
108
- assert_equal @git_name, @generator.user_name
109
- end
110
-
111
- should "set email from git config" do
112
- assert_equal @git_email, @generator.user_email
113
- end
114
-
115
- should "set origin remote as github, based on username and project name" do
116
- assert_equal "git@github.com:#{@github_user}/#{@project_name}.git", @generator.git_remote
117
- end
118
-
119
- should "set homepage as github based on username and project name" do
120
- assert_equal "http://github.com/#{@github_user}/#{@project_name}", @generator.homepage
121
- end
122
-
123
- should "set github username from git config" do
124
- assert_equal @github_user, @generator.github_username
125
- end
126
-
127
- should "set project name as the-perfect-gem" do
128
- assert_equal @project_name, @generator.project_name
129
- end
130
- end
131
-
132
- context "using yard" do
133
- setup do
134
- @generator = build_generator(:documentation_framework => :yard)
135
- end
136
-
137
- should "set the doc_task to yardoc" do
138
- assert_equal "yardoc", @generator.doc_task
139
- end
140
-
141
- end
142
-
143
- context "using rdoc" do
144
- setup do
145
- @generator = build_generator(:documentation_framework => :rdoc)
146
- end
147
-
148
- should "set the doc_task to rdoc" do
149
- assert_equal "rdoc", @generator.doc_task
150
- end
151
- end
152
-
153
- context "using a custom homepage" do
154
- setup do
155
- @generator = build_generator(:homepage => 'http://zomg.com')
156
- end
157
-
158
- should "set the homepage" do
159
- assert_equal "http://zomg.com", @generator.homepage
160
- end
161
-
162
- end
163
-
164
- end
@@ -1,23 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestGeneratorMixins < Test::Unit::TestCase
4
-
5
- [Jeweler::Generator::BaconMixin,
6
- Jeweler::Generator::MicronautMixin,
7
- Jeweler::Generator::MinitestMixin,
8
- Jeweler::Generator::RspecMixin,
9
- Jeweler::Generator::ShouldaMixin,
10
- Jeweler::Generator::TestspecMixin,
11
- Jeweler::Generator::TestunitMixin,
12
- ].each do |mixin|
13
- context "#{mixin}" do
14
- %w(default_task feature_support_require feature_support_extend
15
- test_dir test_task test_pattern test_filename
16
- test_helper_filename).each do |method|
17
- should "define #{method}" do
18
- assert mixin.method_defined?(method)
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,237 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestSpecification < Test::Unit::TestCase
4
- def setup
5
- @project = create_construct
6
- end
7
-
8
- def teardown
9
- @project.destroy!
10
- end
11
-
12
- def build_jeweler_gemspec(&block)
13
- gemspec = if block
14
- Gem::Specification.new(&block)
15
- else
16
- Gem::Specification.new()
17
- end
18
- gemspec.extend(Jeweler::Specification)
19
- gemspec
20
- end
21
-
22
- should "be able to use to_ruby on a duped gemspec without error" do
23
- gemspec = build_jeweler_gemspec
24
- gemspec.files.include 'throwaway value'
25
-
26
- gemspec.dup.to_ruby
27
- end
28
-
29
- context "basic defaults" do
30
- setup do
31
- @gemspec = build_jeweler_gemspec
32
- end
33
-
34
- should "make files a FileList" do
35
- assert_equal FileList, @gemspec.files.class
36
- end
37
-
38
- should "make extra_rdoc_files a FileList" do
39
- assert_equal FileList, @gemspec.extra_rdoc_files.class
40
- end
41
-
42
- end
43
-
44
- context "there aren't any executables in the project directory" do
45
- setup do
46
- @project.directory 'bin'
47
- end
48
-
49
- context "and there hasn't been any set on the gemspec" do
50
- setup do
51
- @gemspec = build_jeweler_gemspec
52
- @gemspec.set_jeweler_defaults(@project)
53
- end
54
-
55
-
56
- should "have empty gemspec executables" do
57
- assert_equal [], @gemspec.executables
58
- end
59
- end
60
-
61
- context "and has been previously set executables" do
62
- setup do
63
- @gemspec = build_jeweler_gemspec do |gemspec|
64
- gemspec.executables = %w(non-existant)
65
- end
66
- @gemspec.set_jeweler_defaults(@project)
67
- end
68
-
69
- should "have only the original executables in the gemspec" do
70
- assert_equal %w(non-existant), @gemspec.executables
71
- end
72
- end
73
- end
74
-
75
- context "there are multiple executables in the project directory" do
76
- setup do
77
- @project.directory('bin') do |bin|
78
- bin.file 'burnination'
79
- bin.file 'trogdor'
80
- end
81
- repo = Git.init(@project.to_s)
82
- repo.add('bin/burnination')
83
- repo.commit('Initial commit')
84
- end
85
-
86
- context "and there hasn't been any set on the gemspec" do
87
- setup do
88
- @gemspec = build_jeweler_gemspec
89
- @gemspec.set_jeweler_defaults(@project)
90
- end
91
-
92
- should "have the executables under version control in the gemspec" do
93
- assert_equal %w(burnination), @gemspec.executables
94
- end
95
- end
96
- context "and has been previously set executables" do
97
- setup do
98
- @gemspec = build_jeweler_gemspec do |gemspec|
99
- gemspec.executables = %w(burnination)
100
- end
101
- @gemspec.set_jeweler_defaults(@project)
102
- end
103
- should "have only the original executables in the gemspec" do
104
- assert_equal %w(burnination), @gemspec.executables
105
- end
106
- end
107
- end
108
-
109
- context "there are mutiple extconf.rb and mkrf_conf.rb in the project directory" do
110
- setup do
111
- @project.directory('ext') do |ext|
112
- ext.file 'extconf.rb'
113
- ext.file 'mkrf_conf.rb'
114
- ext.directory('trogdor_native') do |trogdor_native|
115
- trogdor_native.file 'extconf.rb'
116
- trogdor_native.file 'mkrf_conf.rb'
117
- end
118
- end
119
- end
120
-
121
- context "and there hasn't been any extensions set on the gemspec" do
122
- setup do
123
- @gemspec = build_jeweler_gemspec
124
- @gemspec.set_jeweler_defaults(@project)
125
- end
126
-
127
- should "have all the extconf.rb and mkrf_config.rb files in extensions" do
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
- end
130
-
131
- end
132
-
133
- end
134
-
135
- context "there are some files and is setup for git" do
136
- setup do
137
- @project.file 'Rakefile'
138
- @project.directory('lib') do |lib|
139
- lib.file 'example.rb'
140
- end
141
-
142
- repo = Git.init(@project.to_s)
143
- repo.add('.')
144
- repo.commit('Initial commit')
145
- end
146
-
147
- context "and the files defaults are used" do
148
- setup do
149
- @gemspec = build_jeweler_gemspec
150
- @gemspec.set_jeweler_defaults(@project, @project)
151
- end
152
-
153
- should "populate files from git" do
154
- assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
155
- end
156
- end
157
-
158
- context "and the files specified manually" do
159
- setup do
160
- @gemspec = build_jeweler_gemspec do |gemspec|
161
- gemspec.files = %w(Rakefile)
162
- end
163
- @gemspec.set_jeweler_defaults(@project, @project)
164
- end
165
-
166
- should "not be overridden by files from git" do
167
- assert_equal %w(Rakefile), @gemspec.files
168
- end
169
- end
170
-
171
- end
172
-
173
- context "there are some files and is setup for git with ignored files" do
174
- setup do
175
- @project.file '.gitignore', 'ignored'
176
- @project.file 'ignored'
177
- @project.file 'Rakefile'
178
- @project.directory('lib') do |lib|
179
- lib.file 'example.rb'
180
- end
181
-
182
- repo = Git.init(@project.to_s)
183
- repo.add('.')
184
- repo.commit('Initial commit')
185
-
186
-
187
- @gemspec = build_jeweler_gemspec
188
- @gemspec.set_jeweler_defaults(@project, @project)
189
- end
190
-
191
- should "populate files from git excluding ignored and .gitignore" do
192
- assert_equal %w(Rakefile lib/example.rb), @gemspec.files.sort
193
- end
194
- end
195
-
196
- context "there are some files and is setup for git and working in a sub directory" do
197
- setup do
198
- @subproject = File.join(@project, 'subproject')
199
- @project.file 'Rakefile'
200
- @project.file 'README'
201
- @project.directory 'subproject' do |subproject|
202
- subproject.file 'README'
203
- subproject.directory('lib') do |lib|
204
- lib.file 'subproject_example.rb'
205
- end
206
- end
207
-
208
- repo = Git.init(@project.to_s)
209
- repo.add('.')
210
- repo.commit('Initial commit')
211
-
212
- @gemspec = build_jeweler_gemspec
213
- @gemspec.set_jeweler_defaults(@subproject, @project)
214
- end
215
-
216
- should "populate files from git relative to sub directory" do
217
- assert_equal %w(lib/subproject_example.rb README).sort, @gemspec.files.sort
218
- end
219
- end
220
-
221
- context "there are some files and is not setup for git" do
222
- setup do
223
- @project.file 'Rakefile'
224
- @project.directory('lib') do |lib|
225
- lib.file 'example.rb'
226
- end
227
-
228
- @gemspec = build_jeweler_gemspec
229
- @gemspec.set_jeweler_defaults(@project, @project)
230
- end
231
-
232
- should "not populate files" do
233
- assert_equal [], @gemspec.files.sort
234
- end
235
- end
236
-
237
- end