mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-19 13:09:23 +08:00
Add failing tests for http://hipbyte.myjetbrains.com/youtrack/issue/RM-447
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user