Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #59 from tmiller/inject-test-touchup

Make injector spec more consistent
  • Loading branch information...
commit cb92a2b9240364e312d9b35765e5a7ccc6bba0eb 2 parents f7953a8 + 85e1aa7
@garybernhardt authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 spec/injector_spec.rb
View
5 spec/injector_spec.rb
@@ -9,6 +9,8 @@ def method_taking_only_a_block(&block); 'nothing' end
def method_taking_subject(subject); subject; end
def method_taking_optional_id(id = 0); id; end
def method_taking_optional_arg(uninjectable_optional_arg = 0); uninjectable_optional_arg; end
+ def method_taking_exception(exception); exception; end
+ def method_taking_request(rack_request); rack_request; end
let(:injector) do
Raptor::Injector.new([Raptor::Injectables::Fixed.new(:id, 5)])
@@ -65,7 +67,6 @@ def method_taking_optional_arg(uninjectable_optional_arg = 0); uninjectable_opti
end
it "injects requests once it's been given one" do
- def method_taking_request(rack_request); rack_request; end
request = stub
method = method(:method_taking_request)
injector_with_request = injector.add_request(request)
@@ -73,7 +74,6 @@ def method_taking_request(rack_request); rack_request; end
end
it "injects route variables once it's been given the route path" do
- def method_taking_id(id); id; end
request = stub(:path_info => "/posts/5")
method = method(:method_taking_id)
injector_with_route_path = injector.add_route_path(request, "/posts/:id")
@@ -81,7 +81,6 @@ def method_taking_id(id); id; end
end
it "injects an exception after being given an exception" do
- def method_taking_exception(exception); exception; end
e = RuntimeError.new
method = method(:method_taking_exception)
injector_with_exception = injector.add_exception(e)
Please sign in to comment.
Something went wrong with that request. Please try again.