sugarcube 0.20.3 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,9 @@ class UIViewController
13
13
 
14
14
  def pop
15
15
  to_pop = self.childViewControllers[-1]
16
- to_pop.removeFromParentViewController
16
+ if to_pop
17
+ to_pop.removeFromParentViewController
18
+ end
17
19
  end
18
20
 
19
21
  end
@@ -1,3 +1,3 @@
1
1
  module SugarCube
2
- Version = '0.20.3'
2
+ Version = '0.20.4'
3
3
  end
@@ -20,12 +20,16 @@ describe 'UIViewController' do
20
20
  @root_controller.childViewControllers.length.should == 2
21
21
  end
22
22
 
23
- it 'should have `pop()` method' do
23
+ it 'should have `pop` method' do
24
+ @root_controller.childViewControllers.length.should == 0
24
25
  @root_controller.push(@second_controller)
25
- length = @root_controller.childViewControllers.length
26
+ @root_controller.childViewControllers.length.should == 1
26
27
  popped = @root_controller.pop
27
- @root_controller.childViewControllers.length.should == length - 1
28
28
  popped.should == @second_controller
29
+ @root_controller.childViewControllers.length.should == 0
30
+ popped = @root_controller.pop
31
+ popped.should == nil
32
+ @root_controller.childViewControllers.length.should == 0
29
33
  end
30
34
 
31
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugarcube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.3
4
+ version: 0.20.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -229,4 +229,3 @@ test_files:
229
229
  - spec/uiview_spec.rb
230
230
  - spec/uiviewcontroller_spec.rb
231
231
  - spec/unholy_spec.rb
232
- has_rdoc: