This commit is contained in:
Eloy Durán
2014-04-04 11:36:52 +02:00
parent 48cd537b8a
commit 73ad72e54d
2 changed files with 31 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ Motion::Project::App.setup do |app|
# 10.8 and 10.9 are 64-bit only.
if ENV['PLATFORM'] == 'osx' && ENV['ARCH'] == 'i386'
app.deployment_target = '10.7'
app.deployment_target = '10.7' # TODO 10.6?
end
end

View File

@@ -1,5 +1,32 @@
begin
ThisConstDoesSoNotExist
rescue Object => e
$file_scope_exception = e
end
class TestClassScopeExceptions
def self.foo(arg1, arg2)
end
begin
foo(:too_few_args)
rescue Object => e
$class_scope_exception = e
end
end
describe "An exception" do
it "includes backtrace info when raised from a file scope" do
$file_scope_exception.backtrace.first.should.match /exception_spec\.rb:2/
end
it "includes backtrace info when raised from a class scope" do
$class_scope_exception.backtrace.first.should.match /exception_spec\.rb:12/
end
end
describe "NSExceptions" do
xit "can be caught (1)" do
it "can be caught (1)" do
exc_name = 'TestException'
exc_reason = 'some reason'
exc_userInfo = { 'One' => 1, 'Two' => 2, 'Three' => 3}
@@ -12,7 +39,7 @@ describe "NSExceptions" do
end
end
xit "can be caught (2)" do
it "can be caught (2)" do
begin
NSString.stringWithString(42)
rescue => e
@@ -21,7 +48,7 @@ describe "NSExceptions" do
end
end
xit "should be raised with Kernel.raise" do
it "should be raised with Kernel.raise" do
begin
raise NSException.exceptionWithName('NSInvalidArgumentException', reason:'Woops!', userInfo:nil)
rescue => e