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:
parent
9b083b6a6e
commit
d7a11503af
14 changed files with 24 additions and 32 deletions
6
Rakefile
6
Rakefile
|
|
@ -7,11 +7,11 @@ end
|
||||||
require "rspec/core/rake_task"
|
require "rspec/core/rake_task"
|
||||||
|
|
||||||
desc "Run all specs"
|
desc "Run all specs"
|
||||||
task :spec => ["spec:unit", "spec:integration"]
|
RSpec::Core::RakeTask.new('spec')
|
||||||
|
|
||||||
desc "Run unit specs"
|
desc "Run unit specs"
|
||||||
RSpec::Core::RakeTask.new('spec:unit') do |t|
|
RSpec::Core::RakeTask.new('spec:unit') do |t|
|
||||||
t.pattern = 'spec/*_spec.rb'
|
t.pattern = 'spec/unit/*_spec.rb'
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run integration specs"
|
desc "Run integration specs"
|
||||||
|
|
@ -22,7 +22,7 @@ end
|
||||||
desc "Print specdocs"
|
desc "Print specdocs"
|
||||||
RSpec::Core::RakeTask.new(:doc) do |t|
|
RSpec::Core::RakeTask.new(:doc) do |t|
|
||||||
t.rspec_opts = ["--format", "specdoc", "--dry-run"]
|
t.rspec_opts = ["--format", "specdoc", "--dry-run"]
|
||||||
t.pattern = 'spec/*_spec.rb'
|
t.pattern = 'spec/**/*_spec.rb'
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run all examples with RCov"
|
desc "Run all examples with RCov"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient do
|
describe RestClient do
|
||||||
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), '../spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RestClient::Request do
|
describe RestClient::Request do
|
||||||
|
before(:all) do
|
||||||
|
WebMock.disable!
|
||||||
|
end
|
||||||
|
|
||||||
|
after(:all) do
|
||||||
|
WebMock.enable!
|
||||||
|
end
|
||||||
|
|
||||||
describe "ssl verification" do
|
describe "ssl verification" do
|
||||||
it "is successful with the correct ca_file" do
|
it "is successful with the correct ca_file" do
|
||||||
request = RestClient::Request.new(
|
request = RestClient::Request.new(
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,5 @@ rescue LoadError
|
||||||
# NOP, ignore
|
# NOP, ignore
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require 'webmock/rspec'
|
||||||
require 'restclient'
|
require 'restclient'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RestClient::AbstractResponse do
|
describe RestClient::AbstractResponse do
|
||||||
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient::Exception do
|
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
|
it "returns a 'message' equal to the class name if the message is not set, because 'message' should not be nil" do
|
||||||
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
|
@ -1,5 +1,6 @@
|
||||||
# encoding: binary
|
# encoding: binary
|
||||||
require File.join(File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RestClient::Payload do
|
describe RestClient::Payload do
|
||||||
context "A regular Payload" do
|
context "A regular Payload" do
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RestClient::RawResponse do
|
describe RestClient::RawResponse do
|
||||||
before do
|
before do
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient::Request do
|
describe RestClient::Request do
|
||||||
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient::Request do
|
describe RestClient::Request do
|
||||||
before do
|
before do
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient::Resource do
|
describe RestClient::Resource do
|
||||||
before do
|
before do
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'webmock/rspec'
|
|
||||||
include WebMock::API
|
|
||||||
|
|
||||||
describe RestClient::Response do
|
describe RestClient::Response do
|
||||||
before do
|
before do
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RestClient do
|
describe RestClient do
|
||||||
describe "API" do
|
describe "API" do
|
||||||
Loading…
Add table
Add a link
Reference in a new issue