1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Reorganize specs

* Put unit and integration specs into separate subdirectories
* Consolidate all requires of 'webmock/rspec' into spec_helper.rb
* Use WebMock.{disable!,enable!} for specs calling live server
This commit is contained in:
Larry Gilbert 2013-08-06 08:44:47 -07:00 committed by Larry Gilbert
parent 9b083b6a6e
commit d7a11503af
14 changed files with 24 additions and 32 deletions

View file

@ -7,11 +7,11 @@ end
require "rspec/core/rake_task"
desc "Run all specs"
task :spec => ["spec:unit", "spec:integration"]
RSpec::Core::RakeTask.new('spec')
desc "Run unit specs"
RSpec::Core::RakeTask.new('spec:unit') do |t|
t.pattern = 'spec/*_spec.rb'
t.pattern = 'spec/unit/*_spec.rb'
end
desc "Run integration specs"
@ -22,7 +22,7 @@ end
desc "Print specdocs"
RSpec::Core::RakeTask.new(:doc) do |t|
t.rspec_opts = ["--format", "specdoc", "--dry-run"]
t.pattern = 'spec/*_spec.rb'
t.pattern = 'spec/**/*_spec.rb'
end
desc "Run all examples with RCov"

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient do

View file

@ -1,6 +1,14 @@
require File.join( File.dirname(File.expand_path(__FILE__)), '../spec_helper')
require 'spec_helper'
describe RestClient::Request do
before(:all) do
WebMock.disable!
end
after(:all) do
WebMock.enable!
end
describe "ssl verification" do
it "is successful with the correct ca_file" do
request = RestClient::Request.new(

View file

@ -8,4 +8,5 @@ rescue LoadError
# NOP, ignore
end
require 'webmock/rspec'
require 'restclient'

View file

@ -1,4 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'spec_helper'
describe RestClient::AbstractResponse do

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient::Exception do
it "returns a 'message' equal to the class name if the message is not set, because 'message' should not be nil" do

View file

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -1,5 +1,6 @@
# encoding: binary
require File.join(File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'spec_helper'
describe RestClient::Payload do
context "A regular Payload" do

View file

@ -1,4 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'spec_helper'
describe RestClient::RawResponse do
before do

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient::Request do

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient::Request do
before do

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient::Resource do
before do

View file

@ -1,7 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'webmock/rspec'
include WebMock::API
require 'spec_helper'
describe RestClient::Response do
before do

View file

@ -1,4 +1,4 @@
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
require 'spec_helper'
describe RestClient do
describe "API" do