diff --git a/Gemfile b/Gemfile index 7360852..cd5ee28 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gemspec gem 'rake' gem 'cucumber', '~> 0.7' gem 'fakeweb', '~> 1.3' -gem 'rspec', '~> 1.3' +gem 'rspec', '~> 3.1' gem 'mongrel', '1.2.0.pre2' group :development do @@ -15,4 +15,4 @@ end group :test do gem 'simplecov', require: false -end \ No newline at end of file +end diff --git a/Rakefile b/Rakefile index 5799c26..d994fb6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,7 @@ -require 'spec/rake/spectask' -Spec::Rake::SpecTask.new(:spec) do |spec| - spec.ruby_opts << '-rubygems' - spec.libs << 'lib' << 'spec' - spec.spec_files = FileList['spec/**/*_spec.rb'] +begin + require 'rspec/core/rake_task' + RSpec::Core::RakeTask.new(:spec) +rescue LoadError end require 'cucumber/rake/task' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 055c65b..73f1aca 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,9 @@ -require 'simplecov' -$:.push File.expand_path("../lib", __FILE__) +require "simplecov" +SimpleCov.start + require "httparty" - -require 'spec/autorun' -require 'fakeweb' +require "fakeweb" def file_fixture(filename) open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename.to_s}")).read @@ -12,7 +11,7 @@ end Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f} -Spec::Runner.configure do |config| +RSpec.configure do |config| config.include HTTParty::StubResponse config.include HTTParty::SSLTestHelper @@ -23,16 +22,29 @@ Spec::Runner.configure do |config| config.after(:suite) do FakeWeb.allow_net_connect = true end -end -Spec::Matchers.define :use_ssl do - match do |connection| - connection.use_ssl? + config.expect_with :rspec do |expectations| + expectations.include_chain_clauses_in_custom_matcher_descriptions = true end -end -Spec::Matchers.define :use_cert_store do |cert_store| - match do |connection| - connection.cert_store == cert_store + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true end + + config.filter_run :focus + config.run_all_when_everything_filtered = true + + config.disable_monkey_patching! + + config.warnings = true + + if config.files_to_run.one? + config.default_formatter = 'doc' + end + + config.profile_examples = 10 + + config.order = :random + + Kernel.srand config.seed end