Permalink
Browse files

alias_method raise_exception to raise_error

- Closes #10.
  • Loading branch information...
1 parent 7205eaa commit 2ea5b4ed7ba11f9171c929fb5f6e727290e1409f @justinko justinko committed with dchelimsky Jul 26, 2010
Showing with 7 additions and 0 deletions.
  1. +1 −0 lib/rspec/matchers/raise_error.rb
  2. +6 −0 spec/rspec/matchers/raise_error_spec.rb
@@ -125,5 +125,6 @@ def negative_expectation?
def raise_error(error=Exception, message=nil, &block)
Matchers::RaiseError.new(error, message, &block)
end
+ alias_method :raise_exception, :raise_error
end
end
@@ -12,6 +12,12 @@
end
end
+describe "raise_exception aliased to raise_error" do
+ it "should pass if anything is raised" do
+ lambda {raise}.should raise_exception
+ end
+end
+
describe "should raise_error {|err| ... }" do
it "passes if there is an error" do
ran = false

0 comments on commit 2ea5b4e

Please sign in to comment.