Skip to content

Commit

Permalink
Reorganised folder structure for specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bblimke committed Aug 28, 2011
1 parent adb8605 commit 09d9031
Show file tree
Hide file tree
Showing 47 changed files with 49 additions and 2,460 deletions.
6 changes: 3 additions & 3 deletions spec/curb_spec.rb → spec/acceptance/curb/curb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'acceptance/webmock_shared'

unless RUBY_PLATFORM =~ /java/
require 'curb_spec_helper'
require 'acceptance/curb/curb_spec_helper'

shared_examples_for "Curb" do
include CurbSpecHelper
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'acceptance/webmock_shared'
require 'ostruct'

unless RUBY_PLATFORM =~ /java/
require 'em_http_request_spec_helper'
require 'acceptance/em_http_request/em_http_request_spec_helper'

describe "Webmock with EM::HttpRequest" do
include EMHttpRequestSpecHelper
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'acceptance/webmock_shared'
require 'ostruct'

require 'httpclient_spec_helper'
require 'acceptance/httpclient/httpclient_spec_helper'

describe "Webmock with HTTPClient" do
include HTTPClientSpecHelper
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'ostruct'
require 'net_http_spec_helper'
require 'net_http_shared'
require 'acceptance/webmock_shared'
require 'acceptance/net_http/net_http_spec_helper'
require 'acceptance/net_http/net_http_shared'

include NetHTTPSpecHelper

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'rubygems'
require 'rspec'
require 'net/http'
require 'net_http_shared'
require 'net/https'
require 'stringio'
require 'acceptance/net_http/net_http_shared'
require 'support/webmock_server'

describe "Real Net:HTTP without webmock", :without_webmock => true do
Expand Down
6 changes: 3 additions & 3 deletions spec/patron_spec.rb → spec/acceptance/patron/patron_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# encoding: utf-8

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'acceptance/webmock_shared'

unless RUBY_PLATFORM =~ /java/
require 'patron_spec_helper'
require 'acceptance/patron/patron_spec_helper'
require 'tmpdir'
require 'fileutils'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'webmock_shared'
require 'spec_helper'
require 'acceptance/webmock_shared'

unless RUBY_PLATFORM =~ /java/
require 'typhoeus_hydra_spec_helper'
require 'acceptance/typhoeus/typhoeus_hydra_spec_helper'

describe "Webmock with Typhoeus::Hydra" do
include TyphoeusHydraSpecHelper
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions spec/webmock_shared.rb → spec/acceptance/webmock_shared.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

unless defined? SAMPLE_HEADERS
SAMPLE_HEADERS = { "Content-Length" => "8888", "Accept" => "application/json" }
Expand Down Expand Up @@ -667,7 +667,7 @@ def call(request)
describe "replying raw responses from file" do

before(:each) do
@file = File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt")
@file = File.new(CURL_EXAMPLE_OUTPUT_PATH)
stub_http_request(:get, "www.example.com").to_return(@file)
@response = http_request(:get, "http://www.example.com/")
end
Expand Down Expand Up @@ -706,7 +706,7 @@ def call(request)
describe "replying responses raw responses from string" do

before(:each) do
@input = File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt").read
@input = File.new(CURL_EXAMPLE_OUTPUT_PATH).read
stub_http_request(:get, "www.example.com").to_return(@input)
@response = http_request(:get, "http://www.example.com/")
end
Expand Down Expand Up @@ -740,7 +740,7 @@ def call(request)
describe "replying raw responses evaluated dynamically" do
before(:each) do
@files = {
"www.example.com" => File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt")
"www.example.com" => File.new(CURL_EXAMPLE_OUTPUT_PATH)
}
end

Expand Down
6 changes: 4 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

require 'webmock/rspec'

require 'network_connection'
require 'support/network_connection'
require 'support/webmock_server'
require 'my_rack_app'
require 'support/my_rack_app'

CURL_EXAMPLE_OUTPUT_PATH = File.expand_path(File.dirname(__FILE__)) + "/support/example_curl_output.txt" unless defined? CURL_EXAMPLE_OUTPUT_PATH

RSpec.configure do |config|
unless NetworkConnection.is_network_available?
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/errors_spec.rb → spec/unit/errors_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe "errors" do
describe WebMock::NetConnectNotAllowedError do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::HttpLibAdapterRegistry do
describe "each_adapter" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::HttpLibAdapter do
describe "adapter_for" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RackResponse do
before :each do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RequestExecutionVerifier do
before(:each) do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RequestPattern do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RequestRegistry do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RequestSignature do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::RequestStub do

Expand Down
8 changes: 4 additions & 4 deletions spec/response_spec.rb → spec/unit/response_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::ResponseFactory do

Expand Down Expand Up @@ -126,7 +126,7 @@

describe "when input is IO" do
before(:each) do
@file = File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt")
@file = File.new(CURL_EXAMPLE_OUTPUT_PATH)
@response = WebMock::Response.new(@file)
end

Expand Down Expand Up @@ -157,7 +157,7 @@

describe "when input is String" do
before(:each) do
@input = File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt").read
@input = File.new(CURL_EXAMPLE_OUTPUT_PATH).read
@response = WebMock::Response.new(@input)
end

Expand Down Expand Up @@ -241,7 +241,7 @@
describe "when raw response is evaluated" do
before(:each) do
@files = {
"www.example.com" => File.new(File.expand_path(File.dirname(__FILE__)) + "/example_curl_output.txt")
"www.example.com" => File.new(CURL_EXAMPLE_OUTPUT_PATH)
}
@request_signature = WebMock::RequestSignature.new(:get, "www.example.com")
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::StubRegistry do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe WebMock::StubRequestSnippet do
describe "to_s" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::Util::HashCounter do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::Util::HashKeysStringifier do

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::Util::Headers do

Expand Down
2 changes: 1 addition & 1 deletion spec/util/json_spec.rb → spec/unit/util/json_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'

describe WebMock::Util::JSON do
it "should parse json without parsing dates" do
Expand Down
2 changes: 1 addition & 1 deletion spec/util/uri_spec.rb → spec/unit/util/uri_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'spec_helper'


URIS_WITHOUT_PATH_OR_PARAMS =
Expand Down
2 changes: 1 addition & 1 deletion spec/webmock_spec.rb → spec/unit/webmock_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec_helper'

describe "WebMock version" do
it "should report version" do
Expand Down
8 changes: 0 additions & 8 deletions spec/vendor/addressable/lib/addressable/uri.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/vendor/addressable/lib/uri.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/vendor/crack/lib/crack.rb

This file was deleted.

59 changes: 0 additions & 59 deletions spec/vendor/right_http_connection-1.2.4/History.txt

This file was deleted.

7 changes: 0 additions & 7 deletions spec/vendor/right_http_connection-1.2.4/Manifest.txt

This file was deleted.

Loading

0 comments on commit 09d9031

Please sign in to comment.