spec/cocoa/nsattributedstring_spec.rb in sugarcube-3.0.6 vs spec/cocoa/nsattributedstring_spec.rb in sugarcube-3.0.7
- old
+ new
@@ -35,8 +35,26 @@
it 'should have `vertical_glyph_form`' do
'test'.attrd.vertical_glyph_form(1).should.have_string_attributes({ NSVerticalGlyphFormAttributeName => 1 })
end
+ it 'should have have `empty?`' do
+ 'test'.attrd.empty?.should == false
+ ''.attrd.empty?.should == true
+ end
+
+ it 'should have `strip`' do
+ 'test '.attrd.strip.should == 'test'.attrd
+ ' test '.attrd.strip.should == 'test'.attrd
+ ' test'.attrd.strip.should == 'test'.attrd
+ "\ntest".attrd.strip.should == 'test'.attrd
+ "\n test".attrd.strip.should == 'test'.attrd
+ "\n test \n".attrd.strip.should == 'test'.attrd
+ "\n test \n".attrd.strip.should == 'test'.attrd
+ "test ".attrd.strip.should == 'test'.attrd
+ "test\n ".attrd.strip.should == 'test'.attrd
+ " \n test".attrd.strip.should == 'test'.attrd
+ end
+
end
end