mcornick-jeweler 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +9 -0
- data/ChangeLog.markdown +111 -0
- data/LICENSE +20 -0
- data/README.markdown +185 -0
- data/ROADMAP +12 -0
- data/Rakefile +103 -0
- data/VERSION.yml +4 -0
- data/bin/jeweler +8 -0
- 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 +151 -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 +68 -0
- data/features/step_definitions/generator_steps.rb +284 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +29 -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 +225 -0
- data/lib/jeweler.rb +153 -0
- data/lib/jeweler/commands.rb +14 -0
- data/lib/jeweler/commands/build_gem.rb +31 -0
- data/lib/jeweler/commands/check_dependencies.rb +52 -0
- data/lib/jeweler/commands/install_gem.rb +40 -0
- data/lib/jeweler/commands/release.rb +86 -0
- data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
- data/lib/jeweler/commands/setup_rubyforge.rb +57 -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 +20 -0
- data/lib/jeweler/gemspec_helper.rb +79 -0
- data/lib/jeweler/generator.rb +306 -0
- data/lib/jeweler/generator/application.rb +54 -0
- data/lib/jeweler/generator/bacon_mixin.rb +43 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +41 -0
- data/lib/jeweler/generator/minitest_mixin.rb +42 -0
- data/lib/jeweler/generator/options.rb +102 -0
- data/lib/jeweler/generator/rdoc_mixin.rb +9 -0
- data/lib/jeweler/generator/rspec_mixin.rb +42 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +42 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/generator/yard_mixin.rb +14 -0
- data/lib/jeweler/rubyforge_tasks.rb +98 -0
- data/lib/jeweler/specification.rb +66 -0
- data/lib/jeweler/tasks.rb +135 -0
- data/lib/jeweler/templates/.document +5 -0
- data/lib/jeweler/templates/.gitignore +5 -0
- data/lib/jeweler/templates/LICENSE +20 -0
- data/lib/jeweler/templates/README.rdoc +18 -0
- data/lib/jeweler/templates/Rakefile +153 -0
- data/lib/jeweler/templates/bacon/flunking.rb +7 -0
- data/lib/jeweler/templates/bacon/helper.rb +8 -0
- 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 +10 -0
- data/lib/jeweler/templates/shoulda/flunking.rb +7 -0
- data/lib/jeweler/templates/shoulda/helper.rb +10 -0
- 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/VERSION.yml +4 -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/bin/foo_the_ultimate_bin +0 -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 +74 -0
- data/test/jeweler/commands/test_release.rb +362 -0
- data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
- data/test/jeweler/commands/test_setup_rubyforge.rb +182 -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/shoulda_macros/jeweler_macros.rb +35 -0
- data/test/test_application.rb +139 -0
- data/test/test_gemspec_helper.rb +40 -0
- data/test/test_generator.rb +166 -0
- data/test/test_generator_initialization.rb +156 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +159 -0
- data/test/test_jeweler.rb +174 -0
- data/test/test_options.rb +149 -0
- data/test/test_specification.rb +61 -0
- data/test/test_tasks.rb +35 -0
- data/test/test_version_helper.rb +153 -0
- metadata +283 -0
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestGeneratorInitialization < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@project_name = 'the-perfect-gem'
|
6
|
+
@git_name = 'foo'
|
7
|
+
@git_email = 'bar@example.com'
|
8
|
+
@github_user = 'technicalpickles'
|
9
|
+
@github_token = 'zomgtoken'
|
10
|
+
end
|
11
|
+
|
12
|
+
def stub_git_config(options = {})
|
13
|
+
stub(Git).global_config() { options }
|
14
|
+
end
|
15
|
+
|
16
|
+
def valid_git_config
|
17
|
+
{ 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user, 'github.token' => @github_token }
|
18
|
+
end
|
19
|
+
|
20
|
+
context "given a nil github repo name" do
|
21
|
+
setup do
|
22
|
+
stub_git_config
|
23
|
+
|
24
|
+
@block = lambda { }
|
25
|
+
end
|
26
|
+
|
27
|
+
should 'raise NoGithubRepoNameGiven' do
|
28
|
+
assert_raise Jeweler::NoGitHubRepoNameGiven do
|
29
|
+
Jeweler::Generator.new(nil)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "without git user's name set" do
|
35
|
+
setup do
|
36
|
+
stub_git_config 'user.email' => @git_email
|
37
|
+
end
|
38
|
+
|
39
|
+
should 'raise an NoGitUserName' do
|
40
|
+
assert_raise Jeweler::NoGitUserName do
|
41
|
+
Jeweler::Generator.new(@project_name)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "without git user's email set" do
|
47
|
+
setup do
|
48
|
+
stub_git_config 'user.name' => @git_name
|
49
|
+
end
|
50
|
+
|
51
|
+
should 'raise NoGitUserName' do
|
52
|
+
assert_raise Jeweler::NoGitUserEmail do
|
53
|
+
Jeweler::Generator.new(@project_name)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "without github username set" do
|
59
|
+
setup do
|
60
|
+
stub_git_config 'user.email' => @git_email, 'user.name' => @git_name
|
61
|
+
end
|
62
|
+
|
63
|
+
should 'raise NotGitHubUser' do
|
64
|
+
assert_raise Jeweler::NoGitHubUser do
|
65
|
+
Jeweler::Generator.new(@project_name)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context "without github token set" do
|
71
|
+
setup do
|
72
|
+
stub_git_config 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user
|
73
|
+
end
|
74
|
+
|
75
|
+
should 'raise NoGitHubToken if creating repo' do
|
76
|
+
assert_raise Jeweler::NoGitHubToken do
|
77
|
+
Jeweler::Generator.new(@project_name, :create_repo => true)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
context "default configuration" do
|
83
|
+
setup do
|
84
|
+
stub_git_config valid_git_config
|
85
|
+
@generator = Jeweler::Generator.new(@project_name)
|
86
|
+
end
|
87
|
+
|
88
|
+
should "use shoulda for testing" do
|
89
|
+
assert_equal :shoulda, @generator.testing_framework
|
90
|
+
end
|
91
|
+
|
92
|
+
should "use rdoc for documentation" do
|
93
|
+
assert_equal :rdoc, @generator.documentation_framework
|
94
|
+
end
|
95
|
+
|
96
|
+
should "set todo in summary" do
|
97
|
+
assert_match /todo/i, @generator.summary
|
98
|
+
end
|
99
|
+
|
100
|
+
should "set todo in description" do
|
101
|
+
assert_match /todo/i, @generator.description
|
102
|
+
end
|
103
|
+
|
104
|
+
should "set target directory to the project name" do
|
105
|
+
assert_equal @project_name, @generator.target_dir
|
106
|
+
end
|
107
|
+
|
108
|
+
should "set user's name from git config" do
|
109
|
+
assert_equal @git_name, @generator.user_name
|
110
|
+
end
|
111
|
+
|
112
|
+
should "set email from git config" do
|
113
|
+
assert_equal @git_email, @generator.user_email
|
114
|
+
end
|
115
|
+
|
116
|
+
should "set a github remote based on username and project name" do
|
117
|
+
assert_equal "git@github.com:#{@github_user}/#{@project_name}.git", @generator.git_remote
|
118
|
+
end
|
119
|
+
|
120
|
+
should "set github username from git config" do
|
121
|
+
assert_equal @github_user, @generator.github_username
|
122
|
+
end
|
123
|
+
|
124
|
+
should "set project name as the-perfect-gem" do
|
125
|
+
assert_equal @project_name, @generator.project_name
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
context "using yard" do
|
130
|
+
setup do
|
131
|
+
@generator = Jeweler::Generator.new(@project_name, :documentation_framework => :yard)
|
132
|
+
end
|
133
|
+
|
134
|
+
should "set the doc_task to yardoc" do
|
135
|
+
assert_equal "yardoc", @generator.doc_task
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
context "using yard" do
|
141
|
+
setup do
|
142
|
+
@generator = Jeweler::Generator.new(@project_name, :documentation_framework => :rdoc)
|
143
|
+
end
|
144
|
+
|
145
|
+
should "set the doc_task to rdoc" do
|
146
|
+
assert_equal "rdoc", @generator.doc_task
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
context "using options" do
|
151
|
+
should "set documentation" do
|
152
|
+
generator = Jeweler::Generator.new(@project_name, :documentation_framework => :yard)
|
153
|
+
assert_equal :yard, generator.documentation_framework
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestGeneratorMixins < Test::Unit::TestCase
|
4
|
+
|
5
|
+
[Jeweler::Generator::BaconMixin, Jeweler::Generator::MicronautMixin,
|
6
|
+
Jeweler::Generator::RspecMixin, Jeweler::Generator::ShouldaMixin,
|
7
|
+
Jeweler::Generator::TestunitMixin, Jeweler::Generator::MinitestMixin].each do |mixin|
|
8
|
+
context "#{mixin}" do
|
9
|
+
%w(default_task feature_support_require feature_support_extend
|
10
|
+
test_dir test_task test_pattern test_filename
|
11
|
+
test_helper_filename).each do |method|
|
12
|
+
should "define #{method}" do
|
13
|
+
assert mixin.method_defined?(method)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
begin
|
5
|
+
require 'ruby-debug'
|
6
|
+
rescue LoadError
|
7
|
+
end
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'shoulda'
|
11
|
+
require 'rr'
|
12
|
+
require 'redgreen'
|
13
|
+
rescue LoadError => e
|
14
|
+
puts "*" * 80
|
15
|
+
puts "Some dependencies needed to run tests were missing. Run the following command to find them:"
|
16
|
+
puts
|
17
|
+
puts "\trake development_dependencies:check"
|
18
|
+
puts "*" * 80
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'time'
|
23
|
+
|
24
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
|
25
|
+
require 'jeweler'
|
26
|
+
|
27
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
28
|
+
require 'shoulda_macros/jeweler_macros'
|
29
|
+
|
30
|
+
TMP_DIR = File.expand_path('../tmp', __FILE__)
|
31
|
+
FIXTURE_DIR = File.expand_path('../fixtures', __FILE__)
|
32
|
+
|
33
|
+
class RubyForgeStub
|
34
|
+
attr_accessor :userconfig, :autoconfig
|
35
|
+
def initialize
|
36
|
+
@userconfig = {}
|
37
|
+
@autoconfig = {}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Test::Unit::TestCase
|
42
|
+
include RR::Adapters::TestUnit unless include?(RR::Adapters::TestUnit)
|
43
|
+
|
44
|
+
def tmp_dir
|
45
|
+
TMP_DIR
|
46
|
+
end
|
47
|
+
|
48
|
+
def fixture_dir
|
49
|
+
File.join(FIXTURE_DIR, 'bar')
|
50
|
+
end
|
51
|
+
|
52
|
+
def remove_tmpdir!
|
53
|
+
FileUtils.rm_rf(tmp_dir)
|
54
|
+
end
|
55
|
+
|
56
|
+
def create_tmpdir!
|
57
|
+
FileUtils.mkdir_p(tmp_dir)
|
58
|
+
end
|
59
|
+
|
60
|
+
def build_spec(*files)
|
61
|
+
Gem::Specification.new do |s|
|
62
|
+
s.name = "bar"
|
63
|
+
s.summary = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
64
|
+
s.email = "josh@technicalpickles.com"
|
65
|
+
s.homepage = "http://github.com/technicalpickles/jeweler"
|
66
|
+
s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
67
|
+
s.authors = ["Josh Nichols"]
|
68
|
+
s.files = FileList[*files] unless files.empty?
|
69
|
+
s.version = '0.1.1'
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.gemcutter_command_context(description, &block)
|
74
|
+
context description do
|
75
|
+
setup do
|
76
|
+
@command = eval(self.class.name.gsub(/::Test/, '::')).new
|
77
|
+
|
78
|
+
if @command.respond_to? :gemspec_helper=
|
79
|
+
@gemspec_helper = Object.new
|
80
|
+
@command.gemspec_helper = @gemspec_helper
|
81
|
+
end
|
82
|
+
|
83
|
+
if @command.respond_to? :output
|
84
|
+
@output = StringIO.new
|
85
|
+
@command.output = @output
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "", &block
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.rubyforge_command_context(description, &block)
|
94
|
+
context description do
|
95
|
+
setup do
|
96
|
+
@command = eval(self.class.name.gsub(/::Test/, '::')).new
|
97
|
+
|
98
|
+
if @command.respond_to? :gemspec=
|
99
|
+
@gemspec = Object.new
|
100
|
+
@command.gemspec = @gemspec
|
101
|
+
end
|
102
|
+
|
103
|
+
if @command.respond_to? :gemspec_helper=
|
104
|
+
@gemspec_helper = Object.new
|
105
|
+
@command.gemspec_helper = @gemspec_helper
|
106
|
+
end
|
107
|
+
|
108
|
+
if @command.respond_to? :rubyforge=
|
109
|
+
@rubyforge = RubyForgeStub.new
|
110
|
+
@command.rubyforge = @rubyforge
|
111
|
+
end
|
112
|
+
|
113
|
+
if @command.respond_to? :output
|
114
|
+
@output = StringIO.new
|
115
|
+
@command.output = @output
|
116
|
+
end
|
117
|
+
|
118
|
+
if @command.respond_to? :repo
|
119
|
+
@repo = Object.new
|
120
|
+
@command.repo = @repo
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
context "", &block
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.build_command_context(description, &block)
|
129
|
+
context description do
|
130
|
+
setup do
|
131
|
+
|
132
|
+
@repo = Object.new
|
133
|
+
@version_helper = Object.new
|
134
|
+
@gemspec = Object.new
|
135
|
+
@commit = Object.new
|
136
|
+
@version = Object.new
|
137
|
+
@output = Object.new
|
138
|
+
@base_dir = Object.new
|
139
|
+
@gemspec_helper = Object.new
|
140
|
+
@rubyforge = Object.new
|
141
|
+
|
142
|
+
@jeweler = Object.new
|
143
|
+
|
144
|
+
stub(@jeweler).repo { @repo }
|
145
|
+
stub(@jeweler).version_helper { @version_helper }
|
146
|
+
stub(@jeweler).gemspec { @gemspec }
|
147
|
+
stub(@jeweler).commit { @commit }
|
148
|
+
stub(@jeweler).version { @version }
|
149
|
+
stub(@jeweler).output { @output }
|
150
|
+
stub(@jeweler).gemspec_helper { @gemspec_helper }
|
151
|
+
stub(@jeweler).base_dir { @base_dir }
|
152
|
+
stub(@jeweler).rubyforge { @rubyforge }
|
153
|
+
end
|
154
|
+
|
155
|
+
context "", &block
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
end
|
@@ -0,0 +1,174 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestJeweler < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def build_jeweler(base_dir = nil)
|
6
|
+
base_dir ||= non_git_dir_path
|
7
|
+
FileUtils.mkdir_p base_dir
|
8
|
+
|
9
|
+
Jeweler.new(build_spec, base_dir)
|
10
|
+
end
|
11
|
+
|
12
|
+
def git_dir_path
|
13
|
+
File.join(tmp_dir, 'git')
|
14
|
+
end
|
15
|
+
|
16
|
+
def non_git_dir_path
|
17
|
+
File.join(tmp_dir, 'nongit')
|
18
|
+
end
|
19
|
+
|
20
|
+
def build_git_dir
|
21
|
+
|
22
|
+
FileUtils.mkdir_p git_dir_path
|
23
|
+
Dir.chdir git_dir_path do
|
24
|
+
Git.init
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def build_non_git_dir
|
29
|
+
FileUtils.mkdir_p non_git_dir_path
|
30
|
+
end
|
31
|
+
|
32
|
+
should "raise an error if a nil gemspec is given" do
|
33
|
+
assert_raises Jeweler::GemspecError do
|
34
|
+
Jeweler.new(nil)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
should "know if it is in a git repo" do
|
39
|
+
build_git_dir
|
40
|
+
|
41
|
+
assert build_jeweler(git_dir_path).in_git_repo?
|
42
|
+
end
|
43
|
+
|
44
|
+
should "know if it is not in a git repo" do
|
45
|
+
build_non_git_dir
|
46
|
+
|
47
|
+
jeweler = build_jeweler(non_git_dir_path)
|
48
|
+
assert ! jeweler.in_git_repo?, "jeweler doesn't know that #{jeweler.base_dir} is not a git repository"
|
49
|
+
end
|
50
|
+
|
51
|
+
should "build and run write gemspec command when writing gemspec" do
|
52
|
+
jeweler = build_jeweler
|
53
|
+
|
54
|
+
command = Object.new
|
55
|
+
mock(command).run
|
56
|
+
|
57
|
+
mock(Jeweler::Commands::WriteGemspec).build_for(jeweler) { command }
|
58
|
+
|
59
|
+
jeweler.write_gemspec
|
60
|
+
end
|
61
|
+
|
62
|
+
should "build and run validate gemspec command when validating gemspec" do
|
63
|
+
jeweler = build_jeweler
|
64
|
+
|
65
|
+
command = Object.new
|
66
|
+
mock(command).run
|
67
|
+
|
68
|
+
mock(Jeweler::Commands::ValidateGemspec).build_for(jeweler) { command }
|
69
|
+
|
70
|
+
jeweler.validate_gemspec
|
71
|
+
end
|
72
|
+
|
73
|
+
should "build and run build gem command when building gem" do
|
74
|
+
jeweler = build_jeweler
|
75
|
+
|
76
|
+
command = Object.new
|
77
|
+
mock(command).run
|
78
|
+
|
79
|
+
mock(Jeweler::Commands::BuildGem).build_for(jeweler) { command }
|
80
|
+
|
81
|
+
jeweler.build_gem
|
82
|
+
end
|
83
|
+
|
84
|
+
should "build and run build gem command when installing gem" do
|
85
|
+
jeweler = build_jeweler
|
86
|
+
|
87
|
+
command = Object.new
|
88
|
+
mock(command).run
|
89
|
+
|
90
|
+
mock(Jeweler::Commands::InstallGem).build_for(jeweler) { command }
|
91
|
+
|
92
|
+
jeweler.install_gem
|
93
|
+
end
|
94
|
+
|
95
|
+
should "build and run bump major version command when bumping major version" do
|
96
|
+
jeweler = build_jeweler
|
97
|
+
|
98
|
+
command = Object.new
|
99
|
+
mock(command).run
|
100
|
+
|
101
|
+
mock(Jeweler::Commands::Version::BumpMajor).build_for(jeweler) { command }
|
102
|
+
|
103
|
+
jeweler.bump_major_version
|
104
|
+
end
|
105
|
+
|
106
|
+
should "build and run bump minor version command when bumping minor version" do
|
107
|
+
jeweler = build_jeweler
|
108
|
+
|
109
|
+
command = Object.new
|
110
|
+
mock(command).run
|
111
|
+
|
112
|
+
mock(Jeweler::Commands::Version::BumpMinor).build_for(jeweler) { command }
|
113
|
+
|
114
|
+
jeweler.bump_minor_version
|
115
|
+
end
|
116
|
+
|
117
|
+
should "build and run write version command when writing version" do
|
118
|
+
jeweler = build_jeweler
|
119
|
+
|
120
|
+
command = Object.new
|
121
|
+
mock(command).run
|
122
|
+
mock(command).major=(1)
|
123
|
+
mock(command).minor=(5)
|
124
|
+
mock(command).patch=(2)
|
125
|
+
|
126
|
+
mock(Jeweler::Commands::Version::Write).build_for(jeweler) { command }
|
127
|
+
|
128
|
+
jeweler.write_version(1, 5, 2)
|
129
|
+
end
|
130
|
+
|
131
|
+
should "build and run release command when running release" do
|
132
|
+
jeweler = build_jeweler
|
133
|
+
|
134
|
+
command = Object.new
|
135
|
+
mock(command).run
|
136
|
+
|
137
|
+
mock(Jeweler::Commands::Release).build_for(jeweler) { command }
|
138
|
+
|
139
|
+
jeweler.release
|
140
|
+
end
|
141
|
+
|
142
|
+
should "build and run release to rubyforge command when running release to rubyforge" do
|
143
|
+
jeweler = build_jeweler
|
144
|
+
|
145
|
+
command = Object.new
|
146
|
+
mock(command).run
|
147
|
+
|
148
|
+
mock(Jeweler::Commands::ReleaseToRubyforge).build_for(jeweler) { command }
|
149
|
+
|
150
|
+
jeweler.release_gem_to_rubyforge
|
151
|
+
end
|
152
|
+
|
153
|
+
|
154
|
+
should "respond to gemspec_helper" do
|
155
|
+
assert_respond_to build_jeweler, :gemspec_helper
|
156
|
+
end
|
157
|
+
|
158
|
+
should "respond to version_helper" do
|
159
|
+
assert_respond_to build_jeweler, :version_helper
|
160
|
+
end
|
161
|
+
|
162
|
+
should "respond to repo" do
|
163
|
+
assert_respond_to build_jeweler, :repo
|
164
|
+
end
|
165
|
+
|
166
|
+
should "respond to commit" do
|
167
|
+
assert_respond_to build_jeweler, :commit
|
168
|
+
end
|
169
|
+
|
170
|
+
should "respond to rubyforge" do
|
171
|
+
assert_respond_to build_jeweler, :rubyforge
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|