1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Bump RSpec from 1.3 to 3.1

- Update spec_helper
- Update rake task for running specs
This commit is contained in:
Michael Stock 2014-12-06 16:10:24 -08:00
parent 9bb48b46ac
commit a394cd28a8
3 changed files with 32 additions and 21 deletions

View file

@ -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
end

View file

@ -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'

View file

@ -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