Permalink
Browse files

reset ivar @controller if constant is not available

  • Loading branch information...
1 parent 375b40b commit c4b4b32a0c48deb6a88d82ad43256c309a9bd0e0 @mhorbul mhorbul committed Oct 16, 2011
Showing with 3 additions and 0 deletions.
  1. +1 −0 lib/wsdsl.rb
  2. +2 −0 spec/wsdsl_spec.rb
View
@@ -175,6 +175,7 @@ def controller_dispatch(app)
@controller = @controller.const_get(const)
end
rescue NameError => e
+ @controller = nil
raise "The #{@controller_name} class was not found"
end
end
View
@@ -164,6 +164,8 @@ class ItemsController < ProjectsController
service = WSList.all.find{|s| s.url == "unknown.xml"}
lambda { service.controller_dispatch("application") }.
should raise_error("The UnknownController class was not found")
+ lambda { service.controller_dispatch("application") }.
+ should raise_error("The UnknownController class was not found")
end
end

0 comments on commit c4b4b32

Please sign in to comment.