class TestNavigationController::WithChildren

Public Instance Methods

setup() click to toggle source
# File test/navigation_controller_test.rb, line 103
def setup
  @subject = NavigationController.new(ViewController.new)
  @children = [ViewController.new, ViewController.new, ViewController.new]
  @children.each { |child| @subject.push_view_controller(child) }
end
test_appearing_only_shows_last_child() click to toggle source
# File test/navigation_controller_test.rb, line 114
def test_appearing_only_shows_last_child
  @subject.begin_appearance_transition(true)
  @subject.end_appearance_transition()
  last = @children.pop
  assert last.appeared?
  refute @subject.root_view_controller.appeared?
  refute @children.any? &:appeared?
end
test_pop_to_root_removes_children() click to toggle source
# File test/navigation_controller_test.rb, line 123
def test_pop_to_root_removes_children
  assert_equal @children, @subject.pop_to_root_view_controller()
end
test_pop_view_controller_returns_last_child() click to toggle source
# File test/navigation_controller_test.rb, line 109
def test_pop_view_controller_returns_last_child
  last = @children.last
  assert_equal last, @subject.pop_view_controller()
end