mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
added tests for new prepend_segments styler
This commit is contained in:
26
spec/stylers/ui_segmented_control_styler.rb
Normal file
26
spec/stylers/ui_segmented_control_styler.rb
Normal 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
|
||||
Reference in New Issue
Block a user