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"
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,4 +8,5 @@ rescue LoadError
 | 
			
		|||
  # NOP, ignore
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
require 'webmock/rspec'
 | 
			
		||||
require 'restclient'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
 | 
			
		||||
require 'spec_helper'
 | 
			
		||||
 | 
			
		||||
describe RestClient::AbstractResponse do
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB  | 
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
 | 
			
		||||
require 'spec_helper'
 | 
			
		||||
 | 
			
		||||
describe RestClient::RawResponse do
 | 
			
		||||
  before do
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
require File.join( File.dirname(File.expand_path(__FILE__)), 'spec_helper')
 | 
			
		||||
require 'spec_helper'
 | 
			
		||||
 | 
			
		||||
describe RestClient do
 | 
			
		||||
  describe "API" do
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue