Skip to content

Commit

Permalink
Rspec 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshasselberg committed Jul 1, 2014
1 parent b6c6d8a commit 6c44553
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 47 deletions.
8 changes: 4 additions & 4 deletions spec/rack/typhoeus/middleware/params_decoder/helper_spec.rb
Expand Up @@ -82,13 +82,13 @@
context "and its 0" do
let(:params){ {'0' => 1} }
it 'returns true' do
expect(encoded).to be_true
expect(encoded).to be_truthy
end
end
context "and its not 0" do
let(:params){ {'some-key' => 1}}
it 'returns false' do
expect(encoded).to be_false
expect(encoded).to be_falsey
end
end
end
Expand All @@ -97,15 +97,15 @@
let(:params) { Hash[12.times.map {|i| [i, (i+65).chr]}] }

it "returns true" do
expect(encoded).to be_true
expect(encoded).to be_truthy
end
end

context "when keys are not ascending numbers starting with zero" do
let(:params) { {:a => 1} }

it "returns false" do
expect(encoded).to be_false
expect(encoded).to be_falsey
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/typhoeus/adapters/faraday_spec.rb
Expand Up @@ -256,7 +256,7 @@
end

it "sets ssl_verifypeer to false" do
expect(request.options[:ssl_verifypeer]).to be_false
expect(request.options[:ssl_verifypeer]).to be_falsey
end
end

Expand All @@ -268,7 +268,7 @@
end

it "sets ssl_verifypeer to true" do
expect(request.options[:ssl_verifypeer]).to be_true
expect(request.options[:ssl_verifypeer]).to be_truthy
end
end
end
Expand All @@ -278,15 +278,15 @@
let(:env) { { :parallel_manager => true } }

it "returns true" do
expect(adapter.method(:parallel?).call(env)).to be_true
expect(adapter.method(:parallel?).call(env)).to be_truthy
end
end

context "when no parallel_manager" do
let(:env) { { :parallel_manager => nil } }

it "returns false" do
expect(adapter.method(:parallel?).call(env)).to be_false
expect(adapter.method(:parallel?).call(env)).to be_falsey
end
end
end
Expand Down
24 changes: 12 additions & 12 deletions spec/typhoeus/expectation_spec.rb
Expand Up @@ -88,7 +88,7 @@

context "when array" do
it "adds to responses" do
pending
skip
expectation.and_return([1, 2])
expect(expectation.responses).to eq([1, 2])
end
Expand Down Expand Up @@ -173,15 +173,15 @@ def construct_response(request)
context "when string" do
context "when match" do
it "returns true" do
expect(url_match).to be_true
expect(url_match).to be_truthy
end
end

context "when no match" do
let(:base_url) { "no_match" }

it "returns false" do
expect(url_match).to be_false
expect(url_match).to be_falsey
end
end
end
Expand All @@ -191,15 +191,15 @@ def construct_response(request)
let(:base_url) { /example/ }

it "returns true" do
expect(url_match).to be_true
expect(url_match).to be_truthy
end
end

context "when no match" do
let(:base_url) { /nomatch/ }

it "returns false" do
expect(url_match).to be_false
expect(url_match).to be_falsey
end
end
end
Expand All @@ -208,15 +208,15 @@ def construct_response(request)
let(:base_url) { nil }

it "returns true" do
expect(url_match).to be_true
expect(url_match).to be_truthy
end
end

context "when not string, regexp, nil" do
let(:base_url) { 1 }

it "returns false" do
expect(url_match).to be_false
expect(url_match).to be_falsey
end
end
end
Expand All @@ -231,7 +231,7 @@ def construct_response(request)
let(:request_options) { options }

it "returns true" do
expect(options_match).to be_true
expect(options_match).to be_truthy
end
end

Expand All @@ -240,7 +240,7 @@ def construct_response(request)
let(:request_options) { { :a => 1, :b => 2 } }

it "returns true" do
expect(options_match).to be_true
expect(options_match).to be_truthy
end
end

Expand All @@ -249,7 +249,7 @@ def construct_response(request)
let(:request_options) { options }

it "returns true" do
expect(options_match).to be_true
expect(options_match).to be_truthy
end
end

Expand All @@ -258,15 +258,15 @@ def construct_response(request)
let(:request_options) { options }

it "returns true" do
expect(options_match).to be_true
expect(options_match).to be_truthy
end
end

context "when no match" do
let(:options) { { :a => 1 } }

it "returns false" do
expect(options_match).to be_false
expect(options_match).to be_falsey
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/typhoeus/hydra/cacheable_spec.rb
Expand Up @@ -29,14 +29,14 @@

it "returns response with cached status" do
hydra.add(request)
expect(response.cached?).to be_true
expect(response.cached?).to be_truthy
end

context "when no queued requests" do
it "finishes request" do
expect(request).to receive(:finish).with(response)
hydra.add(request)
expect(response.cached?).to be_true
expect(response.cached?).to be_truthy
end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/typhoeus/request/block_connection_spec.rb
Expand Up @@ -28,15 +28,15 @@
before { request.block_connection = true }

it "returns true" do
expect(request.blocked?).to be_true
expect(request.blocked?).to be_truthy
end
end

context "when false" do
before { request.block_connection = false }

it "returns false" do
expect(request.blocked?).to be_false
expect(request.blocked?).to be_falsey
end
end
end
Expand All @@ -47,15 +47,15 @@
after { Typhoeus::Config.block_connection = false }

it "returns true" do
expect(request.blocked?).to be_true
expect(request.blocked?).to be_truthy
end
end

context "when false" do
before { Typhoeus::Config.block_connection = false }

it "returns false" do
expect(request.blocked?).to be_false
expect(request.blocked?).to be_falsey
end
end
end
Expand All @@ -68,7 +68,7 @@
after { Typhoeus::Config.block_connection = false }

it "takes local" do
expect(request.blocked?).to be_false
expect(request.blocked?).to be_falsey
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/typhoeus/request/cacheable_spec.rb
Expand Up @@ -19,7 +19,7 @@

it "doesn't set cached on response" do
request.response = response
expect(request.response.cached?).to be_false
expect(request.response.cached?).to be_falsey
end
end

Expand All @@ -33,7 +33,7 @@

it "sets cached to true for response" do
request.run
expect(request.response.cached?).to be_true
expect(request.response.cached?).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/typhoeus/request/callbacks_spec.rb
Expand Up @@ -84,7 +84,7 @@

context "when local on_complete and gobal on_success" do
it "runs all global callbacks first" do
pending
skip
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/typhoeus/request/operations_spec.rb
Expand Up @@ -37,7 +37,7 @@
on_body_called = false
request.on_body { |body, response| on_body_called = true }
request.run
expect(on_body_called).to be_true
expect(on_body_called).to be_truthy
expect(request.response.body).to satisfy { |v| v.nil? || v == '' }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/typhoeus/request_spec.rb
Expand Up @@ -70,7 +70,7 @@
after { Typhoeus.configure { |config| config.verbose = false} }

it "respects" do
expect(request.options[:verbose]).to be_true
expect(request.options[:verbose]).to be_truthy
end
end

Expand Down
20 changes: 10 additions & 10 deletions spec/typhoeus/response/status_spec.rb
Expand Up @@ -101,15 +101,15 @@
let(:return_code) { :ok }

it "returns true" do
expect(response.success?).to be_true
expect(response.success?).to be_truthy
end
end

context "when return_code nil" do
let(:return_code) { nil }

it "returns true" do
expect(response.success?).to be_true
expect(response.success?).to be_truthy
end
end
end
Expand All @@ -121,15 +121,15 @@
let(:return_code) { :ok }

it "returns true" do
expect(response.success?).to be_true
expect(response.success?).to be_truthy
end
end

context "when return_code nil" do
let(:return_code) { nil }

it "returns false" do
expect(response.success?).to be_false
expect(response.success?).to be_falsey
end
end
end
Expand All @@ -139,7 +139,7 @@
let(:options) { {:return_code => :ok, :response_code => 500} }

it "returns false" do
expect(response.success?).to be_false
expect(response.success?).to be_falsey
end
end
end
Expand All @@ -155,15 +155,15 @@
let(:return_code) { :ok }

it "returns false" do
expect(response.modified?).to be_false
expect(response.modified?).to be_falsey
end
end

context "when return_code nil" do
let(:return_code) { nil }

it "returns false" do
expect(response.modified?).to be_false
expect(response.modified?).to be_falsey
end
end
end
Expand All @@ -175,15 +175,15 @@
let(:return_code) { :ok }

it "returns false" do
expect(response.modified?).to be_false
expect(response.modified?).to be_falsey
end
end

context "when return_code nil" do
let(:return_code) { nil }

it "returns true" do
expect(response.modified?).to be_false
expect(response.modified?).to be_falsey
end
end
end
Expand All @@ -193,7 +193,7 @@
let(:options) { {:return_code => :ok, :response_code => 500} }

it "returns true" do
expect(response.modified?).to be_true
expect(response.modified?).to be_truthy
end
end
end
Expand Down

0 comments on commit 6c44553

Please sign in to comment.