bamboo_rails 1.0.2 → 1.0.3

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/CHANGELOG CHANGED
@@ -1,11 +1,15 @@
1
1
  = Change Log
2
2
 
3
+ == 1.0.3
4
+
5
+ * Test suite with RSpec to verify the correct behaviour of the `rake bamboo`
6
+ task.
7
+
3
8
  == 1.0.2
4
9
 
5
10
  * Some apps don't use a database at all. In that situation, don't bother
6
11
  trying to prepare a database.
7
12
 
8
-
9
13
  == 1.0.1
10
14
 
11
15
  * Cope with projects that don't use Cucumber or RSpec.
data/Rakefile CHANGED
@@ -3,6 +3,14 @@ require 'rake/gempackagetask'
3
3
  require 'rake/rdoctask'
4
4
  require 'rake/clean'
5
5
  require 'rubyforge'
6
+ require 'spec/rake/spectask'
7
+ require 'ci/reporter/rake/rspec'
8
+
9
+ task :default => :spec
10
+
11
+ task :bamboo => [:package, "ci:setup:rspec", :spec]
12
+
13
+ Spec::Rake::SpecTask.new
6
14
 
7
15
  spec = eval(File.read('bamboo_rails.gemspec'))
8
16
  Rake::GemPackageTask.new(spec) do |t|
@@ -18,4 +26,5 @@ task :release => [:clobber, :package] do
18
26
  rubyforge = RubyForge.new.configure
19
27
  rubyforge.login
20
28
  rubyforge.add_release spec.rubyforge_project, spec.name, spec.version.to_s, "pkg/#{spec.name}-#{spec.version}.gem"
21
- end
29
+ end
30
+
data/bamboo_rails.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'bamboo_rails'
4
- s.version = '1.0.2'
5
- s.date = '2009-05-07'
4
+ s.version = '1.0.3'
5
+ s.date = '2009-05-12'
6
6
  s.authors = ['Graeme Mathieson', 'Rubaidh Ltd']
7
7
  s.email = 'support@rubaidh.com'
8
8
  s.homepage = 'http://github.com/rubaidh/bamboo_rails'
@@ -20,6 +20,7 @@ spec = Gem::Specification.new do |s|
20
20
  bamboo_rails.gemspec CHANGELOG MIT-LICENSE Rakefile README.rdoc
21
21
  tasks/bamboo_rails_tasks.rake
22
22
  lib/bamboo_rails.rb
23
+ spec/spec_helper.rb spec/tasks/tasks_spec.rb
23
24
  )
24
25
 
25
26
  s.has_rdoc = true
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'spec'
3
+
4
+ $: << File.join(File.dirname(__FILE__), '..', 'lib')
5
+ require 'bamboo_rails'
@@ -0,0 +1,163 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'spec_helper')
2
+ require 'rake'
3
+
4
+ describe "Rake tasks" do
5
+ def define_tasks(*tasks)
6
+ tasks.each do |task_name|
7
+ task task_name do
8
+ @tasks_run[task_name] = true
9
+ end
10
+ end
11
+ end
12
+ before(:each) do
13
+ @rake = Rake.application = Rake::Application.new
14
+ load File.join(File.dirname(__FILE__), '..', '..', 'tasks', 'bamboo_rails_tasks.rake')
15
+ @tasks_run = {}
16
+
17
+ define_tasks "log:clear", "environment", "gems:build", "ci:setup:testunit", "test"
18
+ end
19
+
20
+ after(:each) do
21
+ Rake.application = nil
22
+
23
+ # Clear up definitions of RAILS_ENV, both from the environment, and that
24
+ # pesky costant that's been declared.
25
+ ENV.delete "RAILS_ENV"
26
+ Object.send :remove_const, :RAILS_ENV
27
+ end
28
+
29
+ describe "any bamboo task invocation", :shared => true do
30
+ it "should set RAILS_ENV to 'test'" do
31
+ ENV["RAILS_ENV"].should == "test"
32
+ end
33
+
34
+ it "should clear the log files" do
35
+ @tasks_run.should include("log:clear")
36
+ end
37
+
38
+ it "should set up the Rails environment" do
39
+ @tasks_run.should include("environment")
40
+ end
41
+
42
+ it "should build any vendor gems" do
43
+ @tasks_run.should include("gems:build")
44
+ end
45
+
46
+ it "should set up the Test::Unit ci_reporter reports" do
47
+ @tasks_run.should include("ci:setup:testunit")
48
+ end
49
+
50
+ it "should run the Test::Unit tests" do
51
+ @tasks_run.should include("test")
52
+ end
53
+ end
54
+
55
+ describe "running the 'bamboo' task" do
56
+ describe "without any RSpec specs" do
57
+ before(:each) do
58
+ Rake::Task['bamboo'].invoke
59
+ end
60
+
61
+ it_should_behave_like "any bamboo task invocation"
62
+
63
+ it "should not setup the RSpec reports" do
64
+ @tasks_run.should_not include("ci:setup:rspec")
65
+ end
66
+
67
+ it "should not run the spec task" do
68
+ @tasks_run.should_not include("spec:rcov")
69
+ end
70
+ end
71
+
72
+ describe "without any Cucumber features" do
73
+ before(:each) do
74
+ Rake::Task['bamboo'].invoke
75
+ end
76
+
77
+ it_should_behave_like "any bamboo task invocation"
78
+
79
+ it "should not setup the Cucumber reports" do
80
+ @tasks_run.should_not include("ci:setup:cucumber")
81
+ end
82
+
83
+ it "should not run the features task" do
84
+ @tasks_run.should_not include("features")
85
+ end
86
+ end
87
+
88
+ describe "with RSpec specs" do
89
+ before(:each) do
90
+ define_tasks "ci:setup:rspec", "spec:rcov"
91
+ Rake::Task['bamboo'].invoke
92
+ end
93
+
94
+ it_should_behave_like "any bamboo task invocation"
95
+
96
+ it "should setup the RSpec reports" do
97
+ @tasks_run.should include("ci:setup:rspec")
98
+ end
99
+
100
+ it "should run the spec task" do
101
+ @tasks_run.should include("spec:rcov")
102
+ end
103
+ end
104
+
105
+ describe "with Cucumber features" do
106
+ before(:each) do
107
+ define_tasks "ci:setup:cucumber", "features"
108
+ Rake::Task['bamboo'].invoke
109
+ end
110
+
111
+ it_should_behave_like "any bamboo task invocation"
112
+
113
+ it "should setup the Cucumber reports" do
114
+ @tasks_run.should include("ci:setup:cucumber")
115
+ end
116
+
117
+ it "should run the features task" do
118
+ @tasks_run.should include("features")
119
+ end
120
+ end
121
+
122
+ describe "with ActiveRecord available" do
123
+ before(:each) do
124
+ define_tasks "db:migrate:reset"
125
+
126
+ RAILS_ROOT = "/non/existant/path"
127
+ File.stub!(:exist?).with(File.join(RAILS_ROOT, "config", "database.yml")).and_return(true)
128
+
129
+ module ActiveRecord
130
+ end
131
+
132
+ Rake::Task['bamboo'].invoke
133
+ end
134
+
135
+ it_should_behave_like "any bamboo task invocation"
136
+
137
+ it "should run the db:migrate:reset task" do
138
+ @tasks_run.should include("db:migrate:reset")
139
+ end
140
+
141
+ after(:each) do
142
+ Object.send :remove_const, :ActiveRecord
143
+ Object.send :remove_const, :RAILS_ROOT
144
+ end
145
+ end
146
+
147
+ describe "with the gems:build:force task available" do
148
+ before(:each) do
149
+ define_tasks "gems:build:force"
150
+ Rake::Task['bamboo'].invoke
151
+ end
152
+
153
+ it "should run the gems:build:force task" do
154
+ @tasks_run.should include("gems:build:force")
155
+ end
156
+
157
+ it "should not run the gems:build task" do
158
+ @tasks_run.should_not include("gems:build")
159
+ end
160
+ end
161
+ end
162
+
163
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bamboo_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Graeme Mathieson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-05-07 00:00:00 +01:00
13
+ date: 2009-05-12 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,8 @@ files:
41
41
  - README.rdoc
42
42
  - tasks/bamboo_rails_tasks.rake
43
43
  - lib/bamboo_rails.rb
44
+ - spec/spec_helper.rb
45
+ - spec/tasks/tasks_spec.rb
44
46
  has_rdoc: true
45
47
  homepage: http://github.com/rubaidh/bamboo_rails
46
48
  licenses: []