From 0928fafe6fffba2a99043bc66725d3b582aa99ae Mon Sep 17 00:00:00 2001 From: Eloy Duran Date: Fri, 13 Jul 2012 21:33:05 +0200 Subject: [PATCH] Test that an actual different storyboard is loaded. Also simplify option initialization a little. --- .gitignore | 2 ++ lib/motion/spec/helpers/ui.rb | 10 ++-------- .../bacon-ui/resources/AlternateStoryboard.storyboard | 7 +++---- test/bacon-ui/spec/storyboard_spec.rb | 11 +++++++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 09efb655..a53d9a5a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.swp *.orig .DS_Store +*.storyboardc +build diff --git a/lib/motion/spec/helpers/ui.rb b/lib/motion/spec/helpers/ui.rb index e1ce1be0..149b6ec1 100644 --- a/lib/motion/spec/helpers/ui.rb +++ b/lib/motion/spec/helpers/ui.rb @@ -168,13 +168,7 @@ module Bacon # * :navigation => true # * :tab => true def tests(controller_class, options = {}) - @controller_class = controller_class - @options = { - # name of storyboard file in resources directory - :storyboard_name => 'MainStoryboard', - # id of controller as assigned in Xcode - :id => nil - }.merge(options) + @controller_class, @options = controller_class, options extend Bacon::Functional::API extend Bacon::Functional::ContextExt end @@ -227,7 +221,7 @@ module Bacon end def storyboard - @storyboard ||= UIStoryboard.storyboardWithName(@options[:storyboard_name], bundle:nil) + @storyboard ||= UIStoryboard.storyboardWithName(@options[:storyboard] || 'MainStoryboard', bundle:nil) end end diff --git a/test/bacon-ui/resources/AlternateStoryboard.storyboard b/test/bacon-ui/resources/AlternateStoryboard.storyboard index 4da3367c..cba27b02 100644 --- a/test/bacon-ui/resources/AlternateStoryboard.storyboard +++ b/test/bacon-ui/resources/AlternateStoryboard.storyboard @@ -1,7 +1,6 @@ - + - @@ -15,8 +14,8 @@ -