namelessjon-jeweler 0.7.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/ChangeLog.markdown +65 -5
- data/README.markdown +99 -19
- data/ROADMAP +12 -0
- data/Rakefile +87 -23
- data/VERSION.yml +3 -3
- data/bin/jeweler +1 -65
- data/features/generator/cucumber.feature +83 -0
- data/features/generator/directory_layout.feature +76 -0
- data/features/generator/dotdocument.feature +14 -0
- data/features/generator/env_options.feature +9 -0
- data/features/generator/git.feature +94 -0
- data/features/generator/license.feature +11 -0
- data/features/generator/rakefile.feature +110 -0
- data/features/generator/readme.feature +12 -0
- data/features/generator/test.feature +41 -0
- data/features/generator/test_helper.feature +49 -0
- data/features/placeholder.feature +5 -0
- data/features/step_definitions/debug_steps.rb +6 -0
- data/features/step_definitions/filesystem_steps.rb +65 -0
- data/features/step_definitions/generator_steps.rb +251 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +19 -0
- data/features/tasks/build_gem.feature +9 -0
- data/features/tasks/version.feature +24 -0
- data/features/tasks/version_bumping.feature +33 -0
- data/jeweler.gemspec +204 -0
- data/lib/jeweler.rb +52 -147
- data/lib/jeweler/commands.rb +12 -0
- data/lib/jeweler/commands/build_gem.rb +31 -0
- data/lib/jeweler/commands/install_gem.rb +26 -0
- data/lib/jeweler/commands/release.rb +83 -0
- data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
- data/lib/jeweler/commands/setup_rubyforge.rb +38 -0
- data/lib/jeweler/commands/validate_gemspec.rb +30 -0
- data/lib/jeweler/commands/version/base.rb +41 -0
- data/lib/jeweler/commands/version/bump_major.rb +13 -0
- data/lib/jeweler/commands/version/bump_minor.rb +12 -0
- data/lib/jeweler/commands/version/bump_patch.rb +14 -0
- data/lib/jeweler/commands/version/write.rb +12 -0
- data/lib/jeweler/commands/write_gemspec.rb +39 -0
- data/lib/jeweler/errors.rb +13 -1
- data/lib/jeweler/gemspec_helper.rb +76 -0
- data/lib/jeweler/generator.rb +160 -66
- data/lib/jeweler/generator/application.rb +54 -0
- data/lib/jeweler/generator/bacon_mixin.rb +39 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +38 -0
- data/lib/jeweler/generator/minitest_mixin.rb +39 -0
- data/lib/jeweler/generator/options.rb +77 -0
- data/lib/jeweler/generator/rspec_mixin.rb +39 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +39 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/rubyforge_tasks.rb +46 -0
- data/lib/jeweler/specification.rb +65 -0
- data/lib/jeweler/tasks.rb +64 -51
- data/lib/jeweler/templates/.document +5 -0
- data/lib/jeweler/templates/.gitignore +3 -1
- data/lib/jeweler/templates/LICENSE +1 -1
- data/lib/jeweler/templates/README.rdoc +7 -0
- data/lib/jeweler/templates/Rakefile +85 -26
- data/lib/jeweler/templates/bacon/{flunking_spec.rb → flunking.rb} +1 -1
- data/lib/jeweler/templates/bacon/{spec_helper.rb → helper.rb} +2 -2
- data/lib/jeweler/templates/features/default.feature +9 -0
- data/lib/jeweler/templates/features/support/env.rb +8 -0
- data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
- data/lib/jeweler/templates/micronaut/helper.rb +17 -0
- data/lib/jeweler/templates/minitest/flunking.rb +7 -0
- data/lib/jeweler/templates/minitest/helper.rb +11 -0
- data/lib/jeweler/templates/rspec/flunking.rb +7 -0
- data/lib/jeweler/templates/rspec/helper.rb +9 -0
- data/lib/jeweler/templates/shoulda/{flunking_test.rb → flunking.rb} +2 -2
- data/lib/jeweler/templates/shoulda/{test_helper.rb → helper.rb} +2 -2
- data/lib/jeweler/templates/testunit/flunking.rb +7 -0
- data/lib/jeweler/templates/testunit/helper.rb +9 -0
- data/lib/jeweler/version_helper.rb +128 -0
- data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
- data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
- data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
- data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
- data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
- data/test/fixtures/existing-project-with-version-yaml/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-yaml/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
- data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
- data/test/geminstaller.yml +12 -0
- data/test/jeweler/commands/test_build_gem.rb +72 -0
- data/test/jeweler/commands/test_install_gem.rb +21 -0
- data/test/jeweler/commands/test_release.rb +405 -0
- data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
- data/test/jeweler/commands/test_setup_rubyforge.rb +88 -0
- data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
- data/test/jeweler/commands/test_write_gemspec.rb +92 -0
- data/test/jeweler/commands/version/test_base.rb +32 -0
- data/test/jeweler/commands/version/test_bump_major.rb +22 -0
- data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
- data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
- data/test/jeweler/commands/version/test_write.rb +23 -0
- data/test/test_application.rb +139 -0
- data/test/{test_gemspec.rb → test_gemspec_helper.rb} +13 -5
- data/test/test_generator.rb +118 -233
- data/test/test_generator_initialization.rb +113 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +98 -28
- data/test/test_jeweler.rb +136 -95
- data/test/test_options.rb +116 -0
- data/test/test_specification.rb +61 -0
- data/test/test_tasks.rb +17 -6
- data/test/test_version_helper.rb +153 -0
- metadata +160 -34
- data/TODO +0 -13
- data/lib/jeweler/gemspec.rb +0 -41
- data/lib/jeweler/templates/README +0 -9
- data/lib/jeweler/version.rb +0 -83
- data/test/generators/initialization_test.rb +0 -146
- data/test/test_version.rb +0 -115
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Josh Nichols
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "existing-project-with-version"
|
8
|
+
gem.summary = %Q{TODO}
|
9
|
+
gem.email = "josh@technicalpickles.com"
|
10
|
+
gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
|
11
|
+
gem.authors = ["Josh Nichols"]
|
12
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
13
|
+
end
|
14
|
+
rescue LoadError
|
15
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'rake/testtask'
|
19
|
+
Rake::TestTask.new(:test) do |test|
|
20
|
+
test.libs << 'lib' << 'test'
|
21
|
+
test.pattern = 'test/**/*_test.rb'
|
22
|
+
test.verbose = false
|
23
|
+
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
require 'rcov/rcovtask'
|
27
|
+
Rcov::RcovTask.new do |test|
|
28
|
+
test.libs << 'test'
|
29
|
+
test.pattern = 'test/**/*_test.rb'
|
30
|
+
test.verbose = true
|
31
|
+
end
|
32
|
+
rescue LoadError
|
33
|
+
task :rcov do
|
34
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
task :default => :test
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
if File.exist?('VERSION.yml')
|
44
|
+
config = YAML.load(File.read('VERSION.yml'))
|
45
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
46
|
+
else
|
47
|
+
version = ""
|
48
|
+
end
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "existing-project-with-version #{version}"
|
52
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
56
|
+
|
57
|
+
# Rubyforge documentation task
|
58
|
+
begin
|
59
|
+
require 'rake/contrib/sshpublisher'
|
60
|
+
namespace :rubyforge do
|
61
|
+
|
62
|
+
desc "Release gem and RDoc documentation to RubyForge"
|
63
|
+
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
64
|
+
|
65
|
+
namespace :release do
|
66
|
+
desc "Publish RDoc to RubyForge."
|
67
|
+
task :docs => [:rdoc] do
|
68
|
+
config = YAML.load(
|
69
|
+
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
70
|
+
)
|
71
|
+
|
72
|
+
host = "#{config['username']}@rubyforge.org"
|
73
|
+
remote_dir = "/var/www/gforge-projects/existing-project-with-version/"
|
74
|
+
local_dir = 'rdoc'
|
75
|
+
|
76
|
+
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
rescue LoadError
|
81
|
+
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
82
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
1.5.3
|
data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{existing-project-with-version}
|
5
|
+
s.version = "1.5.3"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Josh Nichols"]
|
9
|
+
s.date = %q{2009-03-13}
|
10
|
+
s.email = %q{josh@technicalpickles.com}
|
11
|
+
s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
|
12
|
+
s.files = ["README.rdoc", "VERSION.yml", "lib/existing_project_with_version.rb", "test/existing_project_with_version_test.rb", "test/test_helper.rb", "LICENSE"]
|
13
|
+
s.has_rdoc = true
|
14
|
+
s.homepage = %q{http://github.com/technicalpickles/existing-project-with-version}
|
15
|
+
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubygems_version = %q{1.3.1}
|
18
|
+
s.summary = %q{TODO}
|
19
|
+
|
20
|
+
if s.respond_to? :specification_version then
|
21
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
22
|
+
s.specification_version = 2
|
23
|
+
|
24
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
25
|
+
else
|
26
|
+
end
|
27
|
+
else
|
28
|
+
end
|
29
|
+
end
|
data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb
ADDED
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Josh Nichols
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "existing-project-with-version"
|
8
|
+
gem.summary = %Q{TODO}
|
9
|
+
gem.email = "josh@technicalpickles.com"
|
10
|
+
gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
|
11
|
+
gem.authors = ["Josh Nichols"]
|
12
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
13
|
+
end
|
14
|
+
rescue LoadError
|
15
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'rake/testtask'
|
19
|
+
Rake::TestTask.new(:test) do |test|
|
20
|
+
test.libs << 'lib' << 'test'
|
21
|
+
test.pattern = 'test/**/*_test.rb'
|
22
|
+
test.verbose = false
|
23
|
+
end
|
24
|
+
|
25
|
+
begin
|
26
|
+
require 'rcov/rcovtask'
|
27
|
+
Rcov::RcovTask.new do |test|
|
28
|
+
test.libs << 'test'
|
29
|
+
test.pattern = 'test/**/*_test.rb'
|
30
|
+
test.verbose = true
|
31
|
+
end
|
32
|
+
rescue LoadError
|
33
|
+
task :rcov do
|
34
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
task :default => :test
|
40
|
+
|
41
|
+
require 'rake/rdoctask'
|
42
|
+
Rake::RDocTask.new do |rdoc|
|
43
|
+
if File.exist?('VERSION.yml')
|
44
|
+
config = YAML.load(File.read('VERSION.yml'))
|
45
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
46
|
+
else
|
47
|
+
version = ""
|
48
|
+
end
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "existing-project-with-version #{version}"
|
52
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
56
|
+
|
57
|
+
# Rubyforge documentation task
|
58
|
+
begin
|
59
|
+
require 'rake/contrib/sshpublisher'
|
60
|
+
namespace :rubyforge do
|
61
|
+
|
62
|
+
desc "Release gem and RDoc documentation to RubyForge"
|
63
|
+
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
64
|
+
|
65
|
+
namespace :release do
|
66
|
+
desc "Publish RDoc to RubyForge."
|
67
|
+
task :docs => [:rdoc] do
|
68
|
+
config = YAML.load(
|
69
|
+
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
70
|
+
)
|
71
|
+
|
72
|
+
host = "#{config['username']}@rubyforge.org"
|
73
|
+
remote_dir = "/var/www/gforge-projects/existing-project-with-version/"
|
74
|
+
local_dir = 'rdoc'
|
75
|
+
|
76
|
+
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
rescue LoadError
|
81
|
+
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
82
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{existing-project-with-version}
|
5
|
+
s.version = "1.5.3"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Josh Nichols"]
|
9
|
+
s.date = %q{2009-03-13}
|
10
|
+
s.email = %q{josh@technicalpickles.com}
|
11
|
+
s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
|
12
|
+
s.files = ["README.rdoc", "VERSION.yml", "lib/existing_project_with_version.rb", "test/existing_project_with_version_test.rb", "test/test_helper.rb", "LICENSE"]
|
13
|
+
s.has_rdoc = true
|
14
|
+
s.homepage = %q{http://github.com/technicalpickles/existing-project-with-version}
|
15
|
+
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubygems_version = %q{1.3.1}
|
18
|
+
s.summary = %q{TODO}
|
19
|
+
|
20
|
+
if s.respond_to? :specification_version then
|
21
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
22
|
+
s.specification_version = 2
|
23
|
+
|
24
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
25
|
+
else
|
26
|
+
end
|
27
|
+
else
|
28
|
+
end
|
29
|
+
end
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Dependencies required to run the test suite
|
2
|
+
gems:
|
3
|
+
- name: rspec
|
4
|
+
version: '~> 1.1.12'
|
5
|
+
- name: Shoulda
|
6
|
+
version: '~> 1.2.0'
|
7
|
+
- name: ruby-debug
|
8
|
+
version: '~> 0.10.3'
|
9
|
+
- name: rr
|
10
|
+
version: '~> 0.7.1'
|
11
|
+
- name: mhennemeyer-output_catcher
|
12
|
+
version: '~> 1.0.1'
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# not sure why I need to use this form instead of just require 'test_helper'
|
2
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
|
3
|
+
|
4
|
+
class Jeweler
|
5
|
+
module Commands
|
6
|
+
class TestBuildGem < Test::Unit::TestCase
|
7
|
+
|
8
|
+
context "after running" do
|
9
|
+
setup do
|
10
|
+
@gemspec = Object.new
|
11
|
+
stub(@gemspec).file_name { 'zomg-1.2.3.gem' }
|
12
|
+
|
13
|
+
@gemspec_helper = Object.new
|
14
|
+
stub(@gemspec_helper).parse { @gemspec }
|
15
|
+
|
16
|
+
@builder = Object.new
|
17
|
+
stub(Gem::Builder).new { @builder }
|
18
|
+
stub(@builder).build { 'zomg-1.2.3.gem' }
|
19
|
+
|
20
|
+
@file_utils = Object.new
|
21
|
+
stub(@file_utils).mkdir_p './pkg'
|
22
|
+
stub(@file_utils).mv './zomg-1.2.3.gem', './pkg'
|
23
|
+
|
24
|
+
@base_dir = '.'
|
25
|
+
|
26
|
+
@command = Jeweler::Commands::BuildGem.new
|
27
|
+
@command.base_dir = @base_dir
|
28
|
+
@command.file_utils = @file_utils
|
29
|
+
@command.gemspec_helper = @gemspec_helper
|
30
|
+
|
31
|
+
@command.run
|
32
|
+
end
|
33
|
+
|
34
|
+
should "call gemspec helper's parse" do
|
35
|
+
assert_received(@gemspec_helper) {|gemspec_helper| gemspec_helper.parse }
|
36
|
+
end
|
37
|
+
|
38
|
+
should "build from parsed gemspec" do
|
39
|
+
assert_received(Gem::Builder) {|builder_class| builder_class.new(@gemspec) }
|
40
|
+
assert_received(@builder) {|builder| builder.build }
|
41
|
+
end
|
42
|
+
|
43
|
+
should 'make package directory' do
|
44
|
+
assert_received(@file_utils) {|file_utils| file_utils.mkdir_p './pkg'}
|
45
|
+
end
|
46
|
+
|
47
|
+
should 'move built gem into package directory' do
|
48
|
+
assert_received(@file_utils) {|file_utils| file_utils.mv './zomg-1.2.3.gem', './pkg'}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
build_command_context "build for jeweler" do
|
53
|
+
setup do
|
54
|
+
@command = Jeweler::Commands::BuildGem.build_for(@jeweler)
|
55
|
+
end
|
56
|
+
|
57
|
+
should "assign base_dir" do
|
58
|
+
assert_same @base_dir, @jeweler.base_dir
|
59
|
+
end
|
60
|
+
|
61
|
+
should "assign gemspec_helper" do
|
62
|
+
assert_same @gemspec_helper, @jeweler.gemspec_helper
|
63
|
+
end
|
64
|
+
|
65
|
+
should "return BuildGem" do
|
66
|
+
assert_kind_of Jeweler::Commands::BuildGem, @command
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|