Fixing specs to work in RM 2.0

https://github.com/clearsightstudio/ProMotion/blob/version-0.6/lib/ProMo
tion/screen_helpers/split_screen.rb#L9
This commit is contained in:
Jamon Holmgren
2013-05-17 07:39:45 -07:00
parent 6bf9e33a35
commit 19d6a4f181
4 changed files with 15 additions and 8 deletions

View File

@@ -1,9 +1,4 @@
class TestDelegate < ProMotion::Delegate
def on_load(app, options)
end
# Hack to make RM 2.0 work.
# Ref: http://hipbyte.myjetbrains.com/youtrack/issue/RM-136
def dealloc
end
end

View File

@@ -10,6 +10,10 @@ describe "split screen in tab bar functionality" do
@tab = @app.open_tab_bar @split_screen, HomeScreen, BasicScreen
end
after do
@split_screen.delegate = nil # dereference to avoid memory issue
end
it "should create a UISplitViewController" do
@split_screen.is_a?(UISplitViewController).should == true
end
@@ -46,4 +50,4 @@ describe "split screen in tab bar functionality" do
@tab.viewControllers.first.should == @split_screen
end
end
end

View File

@@ -10,6 +10,10 @@ describe "split screen `open` functionality" do
@split_screen = @app.open_split_screen @master_screen, @detail_screen_1
end
after do
@split_screen.delegate = nil # dereference to avoid memory issue
end
it "should open a new screen in the detail view" do
@master_screen.open @detail_screen_2, in_detail: true
@split_screen.detail_screen.should == @detail_screen_2
@@ -43,4 +47,4 @@ describe "split screen `open` functionality" do
home.navigation_controller.topViewController.should == child
end
end
end

View File

@@ -9,6 +9,10 @@ describe "split screen functionality" do
@split_screen = @app.open_split_screen @master_screen, @detail_screen
end
after do
@split_screen.delegate = nil # dereference to avoid memory issue
end
it "should have created a split screen" do
@split_screen.should != nil
@split_screen.is_a?(UISplitViewController).should == true
@@ -32,4 +36,4 @@ describe "split screen functionality" do
@split_screen.viewControllers.last.should == @detail_screen.main_controller
end
end
end