spec/rackamole/mole_spec.rb in rackamole-0.2.3 vs spec/rackamole/mole_spec.rb in rackamole-0.2.4
- old
+ new
@@ -1,6 +1,7 @@
require File.join(File.dirname(__FILE__), %w[.. spec_helper])
+require 'action_controller'
describe Rack::Mole do
include Rack::Test::Methods
before :each do
@@ -63,11 +64,11 @@
it "should mole a fault issue correctly" do
begin
get "/", nil, @test_env
rescue
last_request.env['mole.stash'].should_not be_nil
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:45:in `error_app'" )
fault.should_not be_nil
fault.count.should == 1
end
end
@@ -76,11 +77,11 @@
2.times do |i|
begin
get "/", nil, env
rescue
last_request.env['mole.stash'].should_not be_nil
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:45:in `error_app'" )
fault.should_not be_nil
fault.count.should == i+1
env = last_request.env
end
end
@@ -90,13 +91,13 @@
env = @test_env
2.times do |i|
begin
env['PATH_INFO'] = "/#{i}"
get "/#{i}", nil, env
- rescue
+ rescue => boom
last_request.env['mole.stash'].should_not be_nil
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:45:in `error_app'" )
fault.should_not be_nil
fault.count.should == i+1
env = last_request.env
end
end
@@ -153,11 +154,11 @@
begin
get "/", nil, @test_env
rescue
@test_store.mole_result[:stack].should have(4).items
last_request.env['mole.stash'].should_not be_nil
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:44:in `error_app'" )
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:45:in `error_app'" )
fault.should_not be_nil
fault.count.should == 1
end
end
@@ -192,10 +193,10 @@
get "/crap/out", nil, @test_env
@test_store.mole_result[:type].should == Rackamole.fault
@test_store.mole_result[:stack].should have(4).items
@test_store.mole_result[:fault].should == 'Oh snap!'
last_request.env['mole.stash'].should_not be_nil
- fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:189" )
+ fault = last_request.env['mole.stash'].send( :find_fault, "/", "./spec/rackamole/mole_spec.rb:190" )
fault.should_not be_nil
fault.count.should == 1
end
end