Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Revert old change that was made because 1.9.0 couldn't rescue a splat…
Browse files Browse the repository at this point in the history
…ted array of Exception classes. MacRuby currently can't use when with the same array and 1.9.2dev does.

Also some other minor changes which didn't work currently on 1.9.2dev, but are nicer anyway imo.
  • Loading branch information
alloy committed Aug 31, 2009
1 parent 9c21d75 commit bc0df84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions lib/bacon.rb
Expand Up @@ -237,17 +237,9 @@ def false?; true; end

class Proc
def raise?(*exceptions)
exceptions = [RuntimeError] if exceptions.empty?
call

# Only to work in 1.9.0, rescue with splat doesn't work there right now
rescue Object => e
case e
when *exceptions
e
else
raise e
end
rescue *(exceptions.empty? ? RuntimeError : exceptions) => e
e
else
false
end
Expand Down Expand Up @@ -285,7 +277,6 @@ def describe(*args, &block) Bacon::Context.new(args.join(' '), &block).run end
def shared(name, &block) Bacon::Shared[name] = block end
end


class Should
# Kills ==, ===, =~, eql?, equal?, frozen?, instance_of?, is_a?,
# kind_of?, nil?, respond_to?, tainted?
Expand Down
2 changes: 1 addition & 1 deletion test/spec_bacon.rb
@@ -1,5 +1,5 @@
$-w,w = nil, $-w
require File.join(File.dirname(__FILE__), '../lib/bacon')
require File.expand_path('../../lib/bacon', __FILE__)
$-w = w

# Hooray for meta-testing.
Expand Down
2 changes: 1 addition & 1 deletion test/spec_should.rb
@@ -1,4 +1,4 @@
require File.join(File.dirname(__FILE__), '../lib/bacon')
require File.expand_path('../../lib/bacon', __FILE__)

describe "#should shortcut for #it('should')" do

Expand Down

0 comments on commit bc0df84

Please sign in to comment.