Permalink
Browse files

Update specs for Rspec 2.0 compatibility.

  • Loading branch information...
1 parent 717e484 commit 7ec0dedf42bd5bf3dfaf1d86138dce674dce206e Luke Redpath committed Jan 12, 2011
Showing with 15 additions and 15 deletions.
  1. 0 spec/spec.opts → .rspec
  2. +1 −1 Gemfile.lock
  3. +5 −6 Rakefile
  4. +3 −3 mimic.gemspec
  5. +3 −3 spec/fake_host_spec.rb
  6. +3 −2 spec/spec_helper.rb
File renamed without changes.
View
@@ -54,5 +54,5 @@ DEPENDENCIES
mocha
rack
rest-client
- rspec
+ rspec (~> 2.4.0)
sinatra
View
@@ -1,20 +1,19 @@
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
desc "Run all Cucumber features"
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
end
desc "Run all specs"
-Spec::Rake::SpecTask.new('specs') do |t|
- t.spec_files = FileList['spec/**/*.rb']
+RSpec::Core::RakeTask.new(:spec) do |t|
end
-task :default => :specs
-task :all => [:specs, :features]
+task :default => :spec
+task :all => [:spec, :features]
require "rake/gempackagetask"
require "rake/rdoctask"
@@ -50,7 +49,7 @@ spec = Gem::Specification.new do |s|
s.add_dependency("json")
# If your tests use any gems, include them here
- s.add_development_dependency("rspec")
+ s.add_development_dependency("rspec", "~> 2.4.0")
s.add_development_dependency("cucumber")
s.add_development_dependency("mocha")
s.add_development_dependency("rest-client")
View
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
s.add_runtime_dependency(%q<daemons>, [">= 0"])
s.add_runtime_dependency(%q<json>, [">= 0"])
- s.add_development_dependency(%q<rspec>, [">= 0"])
+ s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_development_dependency(%q<cucumber>, [">= 0"])
s.add_development_dependency(%q<mocha>, [">= 0"])
s.add_development_dependency(%q<rest-client>, [">= 0"])
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<sinatra>, [">= 0"])
s.add_dependency(%q<daemons>, [">= 0"])
s.add_dependency(%q<json>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
s.add_dependency(%q<rest-client>, [">= 0"])
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<sinatra>, [">= 0"])
s.add_dependency(%q<daemons>, [">= 0"])
s.add_dependency(%q<json>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<rspec>, ["~> 2.4.0"])
s.add_dependency(%q<cucumber>, [">= 0"])
s.add_dependency(%q<mocha>, [">= 0"])
s.add_dependency(%q<rest-client>, [">= 0"])
View
@@ -54,9 +54,9 @@ def request_for(path, options={})
"rack.errors" => StringIO.new,
"rack.input" => StringIO.new }
end
-
- def return_rack_response(code, headers, body)
- simple_matcher "return rack response" do |actual|
+
+ RSpec::Matchers.define :return_rack_response do |code, headers, body|
+ match do |actual|
(actual[0].should == code) &&
(actual[1].should include(headers)) &&
(actual[2].should include(body))
View
@@ -1,9 +1,10 @@
require 'rubygems'
-require 'spec'
+require 'rspec'
require 'mocha'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[.. lib]))
require 'mimic'
+require 'rspec/expectations'
-Spec::Runner.configure do |config|
+Rspec.configure do |config|
config.mock_with :mocha
end

0 comments on commit 7ec0ded

Please sign in to comment.