Skip to content

Commit

Permalink
alias_method raise_exception to raise_error
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed Jul 26, 2010
1 parent 7205eaa commit a8b21c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rspec/matchers/raise_error.rb
Expand Up @@ -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
6 changes: 6 additions & 0 deletions spec/rspec/matchers/raise_error_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit a8b21c0

Please sign in to comment.