Skip to content

Commit

Permalink
Rakefile cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Jul 2, 2013
1 parent 1ffd744 commit 3654004
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 51 deletions.
Empty file added .gemtest
Empty file.
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--order=random
41 changes: 10 additions & 31 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ begin
p.version = CI::Reporter::VERSION
p.rubyforge_name = "caldersphere"
p.readme_file = "README.rdoc"
p.url = "http://caldersphere.rubyforge.org/ci_reporter"
p.urls = ["http://caldersphere.rubyforge.org/ci_reporter"]
p.author = "Nick Sieger"
p.email = "nick@nicksieger.com"
p.readme_file = 'README.rdoc'
Expand Down Expand Up @@ -43,31 +43,6 @@ rescue LoadError
puts "You really need Hoe installed to be able to package this gem"
end

# Hoe insists on setting task :default => :test
# !@#$ no easy way to empty the default list of prerequisites
# Leave my tasks alone, Hoe
%w(default spec).each do |task|
next unless Rake::Task.task_defined?(task)
Rake::Task[task].prerequisites.clear
Rake::Task[task].actions.clear
end

task :default => :spec

RSpecTask = begin
require 'rspec/core/rake_task'
@spec_bin = 'rspec'
RSpec::Core::RakeTask
rescue LoadError
require 'spec/rake/spectask'
@spec_bin = 'spec'
Spec::Rake::SpecTask
end

RSpecTask.new do |t|
t.rspec_opts = "--color"
end

task :generate_output do
rm_rf "acceptance/reports"
ENV['CI_REPORTS'] = "acceptance/reports"
Expand All @@ -77,17 +52,20 @@ task :generate_output do
else
opts = "-rubygems"
end
rspec = "#{Gem.loaded_specs['rspec-core'].gem_dir}/exe/rspec"
cucumber = "#{Gem.loaded_specs['cucumber'].gem_dir}/bin/cucumber"
begin
result_proc = proc {|ok,*| puts "Failures above are expected." unless ok }
ruby "-Ilib #{opts} -rci/reporter/rake/test_unit_loader acceptance/test_unit_example_test.rb", &result_proc
ruby "-Ilib #{opts} -rci/reporter/rake/minitest_loader acceptance/minitest_example_test.rb", &result_proc
ruby "-Ilib #{opts} -S #{@spec_bin} --require ci/reporter/rake/rspec_loader --format CI::Reporter::RSpec acceptance/rspec_example_spec.rb", &result_proc
ruby "-Ilib #{opts} -rci/reporter/rake/cucumber_loader -S cucumber --format CI::Reporter::Cucumber acceptance/cucumber", &result_proc
ruby "-Ilib #{opts} -S #{rspec} --require ci/reporter/rake/rspec_loader --format CI::Reporter::RSpec acceptance/rspec_example_spec.rb", &result_proc
ruby "-Ilib #{opts} -rci/reporter/rake/cucumber_loader -S #{cucumber} --format CI::Reporter::Cucumber acceptance/cucumber", &result_proc
Dir.chdir 'acceptance/spinach' do
Bundler.with_clean_env do
ENV['CI_REPORTS'] = "../reports/spinach"
ruby "-S bundle"
ruby "-I../../lib #{opts} -rci/reporter/rake/spinach_loader -S spinach", &result_proc
sh "bundle"
spinach = "#{Gem.loaded_specs['spinach'].gem_dir}/bin/spinach"
ruby "-I../../lib #{opts} -rci/reporter/rake/spinach_loader -S #{spinach}", &result_proc
end
end
ensure
Expand All @@ -97,7 +75,8 @@ task :generate_output do
end
task :acceptance => :generate_output

RSpecTask.new(:acceptance_spec) do |t|
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:acceptance_spec) do |t|
t.pattern = FileList['acceptance/verification_spec.rb']
t.rspec_opts = "--color"
end
Expand Down
4 changes: 2 additions & 2 deletions acceptance/spinach/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source :rubygems
source 'https://rubygems.org'
gem 'ci_reporter', :path => '../..'
gem 'spinach'
gem 'spinach', '< 0.2'
gem 'rspec'
16 changes: 9 additions & 7 deletions acceptance/spinach/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
PATH
remote: ../..
specs:
ci_reporter (1.8.3)
ci_reporter (1.8.4)
builder (>= 2.1.2)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
builder (3.1.4)
builder (3.2.2)
colorize (0.5.8)
diff-lcs (1.1.3)
gherkin-ruby (0.2.1)
gherkin (2.5.4)
json (>= 1.4.6)
json (1.8.0)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
Expand All @@ -19,9 +21,9 @@ GEM
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
spinach (0.6.0)
spinach (0.1.5.4)
colorize
gherkin-ruby (~> 0.2.0)
gherkin (= 2.5.4)

PLATFORMS
java
Expand All @@ -30,4 +32,4 @@ PLATFORMS
DEPENDENCIES
ci_reporter!
rspec
spinach
spinach (< 0.2)
20 changes: 10 additions & 10 deletions ci_reporter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,55 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nick Sieger"]
s.date = "2013-01-25"
s.date = "2013-07-02"
s.description = "CI::Reporter is an add-on to Test::Unit, RSpec and Cucumber that allows you to generate XML reports of your test, spec and/or feature runs. The resulting files can be read by a continuous integration system that understands Ant's JUnit report XML format, thus allowing your CI system to track test/spec successes and failures."
s.email = "nick@nicksieger.com"
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc"]
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc", "README.rdoc"]
s.files = [".travis.yml", "Gemfile", "Gemfile.lock", "History.txt", "LICENSE.txt", "Manifest.txt", "README.rdoc", "Rakefile", "acceptance/cucumber/cucumber_example.feature", "acceptance/cucumber/step_definitions/development_steps.rb", "acceptance/minitest_example_test.rb", "acceptance/rspec_example_spec.rb", "acceptance/spinach/Gemfile", "acceptance/spinach/Gemfile.lock", "acceptance/spinach/features/spinach_example.feature", "acceptance/spinach/features/steps/example_steps.rb", "acceptance/test_unit_example_test.rb", "acceptance/verification_spec.rb", "ci_reporter.gemspec", "lib/ci/reporter/core.rb", "lib/ci/reporter/cucumber.rb", "lib/ci/reporter/minitest.rb", "lib/ci/reporter/rake/cucumber.rb", "lib/ci/reporter/rake/cucumber_loader.rb", "lib/ci/reporter/rake/minitest.rb", "lib/ci/reporter/rake/minitest_loader.rb", "lib/ci/reporter/rake/rspec.rb", "lib/ci/reporter/rake/rspec_loader.rb", "lib/ci/reporter/rake/spinach.rb", "lib/ci/reporter/rake/spinach_loader.rb", "lib/ci/reporter/rake/test_unit.rb", "lib/ci/reporter/rake/test_unit_loader.rb", "lib/ci/reporter/rake/utils.rb", "lib/ci/reporter/report_manager.rb", "lib/ci/reporter/rspec.rb", "lib/ci/reporter/spinach.rb", "lib/ci/reporter/test_suite.rb", "lib/ci/reporter/test_unit.rb", "lib/ci/reporter/version.rb", "spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb", "spec/spec_helper.rb", "stub.rake", "tasks/ci_reporter.rake", ".gemtest"]
s.homepage = "http://caldersphere.rubyforge.org/ci_reporter"
s.rdoc_options = ["--main", "README.rdoc", "-SHN", "-f", "darkfish"]
s.require_paths = ["lib"]
s.rubyforge_project = "caldersphere"
s.rubygems_version = "1.8.24"
s.rubygems_version = "1.8.23"
s.summary = "CI::Reporter allows you to generate reams of XML for use with continuous integration systems."
s.test_files = ["spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb"]
s.test_files = ["spec/ci/reporter/cucumber_spec.rb", "spec/ci/reporter/output_capture_spec.rb", "spec/ci/reporter/rake/rake_tasks_spec.rb", "spec/ci/reporter/report_manager_spec.rb", "spec/ci/reporter/rspec_spec.rb", "spec/ci/reporter/test_suite_spec.rb", "spec/ci/reporter/test_unit_spec.rb"]

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<builder>, [">= 2.1.2"])
s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
s.add_development_dependency(%q<hoe-git>, ["~> 1.5.0"])
s.add_development_dependency(%q<cucumber>, ["~> 0.10.0"])
s.add_development_dependency(%q<rspec>, ["> 2.0.0"])
s.add_development_dependency(%q<test-unit>, ["> 2.4.9"])
s.add_development_dependency(%q<minitest>, ["~> 2.2.0"])
s.add_development_dependency(%q<spinach>, ["< 0.2"])
s.add_development_dependency(%q<hoe>, ["~> 2.12"])
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
s.add_development_dependency(%q<hoe>, ["~> 3.6"])
else
s.add_dependency(%q<builder>, [">= 2.1.2"])
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_dependency(%q<rdoc>, ["~> 4.0"])
s.add_dependency(%q<hoe-git>, ["~> 1.5.0"])
s.add_dependency(%q<cucumber>, ["~> 0.10.0"])
s.add_dependency(%q<rspec>, ["> 2.0.0"])
s.add_dependency(%q<test-unit>, ["> 2.4.9"])
s.add_dependency(%q<minitest>, ["~> 2.2.0"])
s.add_dependency(%q<spinach>, ["< 0.2"])
s.add_dependency(%q<hoe>, ["~> 2.12"])
s.add_dependency(%q<rdoc>, ["~> 3.10"])
s.add_dependency(%q<hoe>, ["~> 3.6"])
end
else
s.add_dependency(%q<builder>, [">= 2.1.2"])
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_dependency(%q<rdoc>, ["~> 4.0"])
s.add_dependency(%q<hoe-git>, ["~> 1.5.0"])
s.add_dependency(%q<cucumber>, ["~> 0.10.0"])
s.add_dependency(%q<rspec>, ["> 2.0.0"])
s.add_dependency(%q<test-unit>, ["> 2.4.9"])
s.add_dependency(%q<minitest>, ["~> 2.2.0"])
s.add_dependency(%q<spinach>, ["< 0.2"])
s.add_dependency(%q<hoe>, ["~> 2.12"])
s.add_dependency(%q<rdoc>, ["~> 3.10"])
s.add_dependency(%q<hoe>, ["~> 3.6"])
end
end
3 changes: 2 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2006-2012 Nick Sieger <nicksieger@gmail.com>
# Copyright (c) 2006-2013 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.

Expand All @@ -20,4 +20,5 @@
require 'ci/reporter/test_unit'
require 'ci/reporter/rspec'

Test::Unit.run = true
REPORTS_DIR = File.dirname(__FILE__) + "/reports" unless defined?(REPORTS_DIR)

0 comments on commit 3654004

Please sign in to comment.