spec/ios/symbol_constants_spec.rb in sugarcube-2.0.1 vs spec/ios/symbol_constants_spec.rb in sugarcube-2.0.2
- old
+ new
@@ -97,17 +97,29 @@
:left.nstextalignment.should == NSTextAlignmentLeft
:right.nstextalignment.should == NSTextAlignmentRight
:center.nstextalignment.should == NSTextAlignmentCenter
end
- it 'should support `uilinebreakmode`' do
- :word_wrap.uilinebreakmode.should == UILineBreakModeWordWrap
- :character_wrap.uilinebreakmode.should == UILineBreakModeCharacterWrap
- :clip.uilinebreakmode.should == UILineBreakModeClip
- :head_truncation.uilinebreakmode.should == UILineBreakModeHeadTruncation
- :tail_truncation.uilinebreakmode.should == UILineBreakModeTailTruncation
- :middle_truncation.uilinebreakmode.should == UILineBreakModeMiddleTruncation
+ it 'should support `nslinebreakmode`' do
+ :word_wrapping.nslinebreakmode.should == NSLineBreakByWordWrapping
+ :word_wrap.nslinebreakmode.should == NSLineBreakByWordWrapping
+ :word.nslinebreakmode.should == NSLineBreakByWordWrapping
+ :char_wrapping.nslinebreakmode.should == NSLineBreakByCharWrapping
+ :char_wrap.nslinebreakmode.should == NSLineBreakByCharWrapping
+ :character_wrap.nslinebreakmode.should == NSLineBreakByCharWrapping
+ :char.nslinebreakmode.should == NSLineBreakByCharWrapping
+ :clipping.nslinebreakmode.should == NSLineBreakByClipping
+ :clip.nslinebreakmode.should == NSLineBreakByClipping
+ :truncating_head.nslinebreakmode.should == NSLineBreakByTruncatingHead
+ :head_truncation.nslinebreakmode.should == NSLineBreakByTruncatingHead
+ :head.nslinebreakmode.should == NSLineBreakByTruncatingHead
+ :truncating_tail.nslinebreakmode.should == NSLineBreakByTruncatingTail
+ :tail_truncation.nslinebreakmode.should == NSLineBreakByTruncatingTail
+ :tail.nslinebreakmode.should == NSLineBreakByTruncatingTail
+ :truncating_middle.nslinebreakmode.should == NSLineBreakByTruncatingMiddle
+ :middle_truncation.nslinebreakmode.should == NSLineBreakByTruncatingMiddle
+ :middle.nslinebreakmode.should == NSLineBreakByTruncatingMiddle
end
it 'should support `uibaselineadjustment`' do
:align_baselines.uibaselineadjustment.should == UIBaselineAdjustmentAlignBaselines
:align_centers.uibaselineadjustment.should == UIBaselineAdjustmentAlignCenters
@@ -480,12 +492,23 @@
SugarCube.log.length.should > 0
end
it 'should support `uitextalignment`' do
:left.uialignment.should == :left.uitextalignment
+ SugarCube.log.length.should > 0
end
+ it 'should support `uilinebreakmode`' do
+ :word_wrap.uilinebreakmode.should == NSLineBreakByWordWrapping
+ :character_wrap.uilinebreakmode.should == NSLineBreakByCharWrapping
+ :clip.uilinebreakmode.should == NSLineBreakByClipping
+ :head_truncation.uilinebreakmode.should == NSLineBreakByTruncatingHead
+ :tail_truncation.uilinebreakmode.should == NSLineBreakByTruncatingTail
+ :middle_truncation.uilinebreakmode.should == NSLineBreakByTruncatingMiddle
+ SugarCube.log.length.should > 0
+ end
+
it 'should support `uibaselineadjustment`' do
:alignbaselines.uibaselineadjustment.should == UIBaselineAdjustmentAlignBaselines
:aligncenters.uibaselineadjustment.should == UIBaselineAdjustmentAlignCenters
end
@@ -507,19 +530,10 @@
:nameandphone.uikeyboardtype.should == :name_and_phone.uikeyboardtype
:emailaddress.uikeyboardtype.should == :email_address.uikeyboardtype
SugarCube.log.length.should > 0
end
- it 'should support `uilinebreakmode`' do
- :wordwrap.uilinebreakmode.should == :word_wrap.uilinebreakmode
- :characterwrap.uilinebreakmode.should == :character_wrap.uilinebreakmode
- :headtruncation.uilinebreakmode.should == :head_truncation.uilinebreakmode
- :tailtruncation.uilinebreakmode.should == :tail_truncation.uilinebreakmode
- :middletruncation.uilinebreakmode.should == :middle_truncation.uilinebreakmode
- SugarCube.log.length.should > 0
- end
-
it 'should support `nsnumberstyle`' do
:spellout.nsnumberstyle.should == :spell_out.nsnumberstyle
SugarCube.log.length.should > 0
end
@@ -596,10 +610,14 @@
it 'should have alias for `uibaselineadjustment`' do
:align_baselines.uibaseline.should == :align_baselines.uibaselineadjustment
end
+ it 'should have alias for `nslinebreakmode`' do
+ :head.nslinebreakmode.should == :head.nslinebreak
+ end
+
it 'should have alias for `uibordertype`' do
:none.uiborderstyle.should == :none.uibordertype
end
it 'should have alias for `nsdatestyle`' do
@@ -727,9 +745,13 @@
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nstextalignment }
end
it 'should not find nonexistant `uilinebreakmode`' do
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uilinebreakmode }
+ end
+
+ it 'should not find nonexistant `nslinebreakmode`' do
+ should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.nslinebreakmode }
end
it 'should not find nonexistant `uibaselineadjustment`' do
should.raise(SugarCubeNotFoundException) { :definitely_doesnt_exist_i_am_really_sure_of_it.uibaselineadjustment }
end