added tests for new prepend_segments styler

This commit is contained in:
Gant
2015-02-25 16:57:45 -06:00
parent ced6e8247a
commit 9a057074cf

View File

@@ -0,0 +1,26 @@
class StyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
def ui_segment_kitchen_sink(st)
st.prepend_segments = ['One', 'Two']
end
end
describe 'stylers/ui_segmented_control' do
before do
@vc = UIViewController.alloc.init
@vc.rmq.stylesheet = StyleSheetForUIViewStylerTests
@view_klass = UISegmentedControl
end
behaves_like "styler"
it 'should apply a style with every UISegmentedControlStyler wrapper method' do
view = @vc.rmq.append(@view_klass, :ui_segment_kitchen_sink).get
view.tap do |v|
v.titleForSegmentAtIndex(0).should == "One"
v.titleForSegmentAtIndex(1).should == "Two"
end
end
end