Sha256: 102a57750b46c39b6b026d8c9bd4d63f23970d4f090cd173ffceb4d8ae8f3df5

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

describe 'NSAttributeString' do
  describe "should support all attribute names" do
    before do
      @subject = 'test'.attrd
    end

    it "should be sane" do
      @subject.isEqualToAttributedString('test'.attrd).should == true
    end

    # don't care about:
    # it 'should have `attachment`' do
    #   @subject.isEqualToAttributedString('test'.attrd.attachment()).should != true
    # end

    it 'should have `ligature`' do
      'test'.attrd.ligature(2).should.have_string_attributes({ NSLigatureAttributeName => 2 })
    end

    it 'should have `kern`' do
      'test'.attrd.kern(1).should.have_string_attributes({ NSKernAttributeName => 1 })
    end

    it 'should have `stroke_width`' do
      'test'.attrd.stroke_width(1).should.have_string_attributes({ NSStrokeWidthAttributeName => 1 })
    end

    it 'should have `strikethrough_style`' do
      'test'.attrd.strikethrough_style(NSUnderlineStyleSingle).should.have_string_attributes({ NSStrikethroughStyleAttributeName => NSUnderlineStyleSingle })
    end

    it 'should have `shadow`' do
      'test'.attrd.shadow(NSShadow.alloc.init.tap{|s|s.shadowOffset = [1,1]}).should.have_string_attributes({ NSShadowAttributeName => NSShadow.alloc.init.tap{|s|s.shadowOffset = [1,1]} })
    end

    it 'should have `vertical_glyph_form`' do
      'test'.attrd.vertical_glyph_form(1).should.have_string_attributes({ NSVerticalGlyphFormAttributeName => 1 })
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sugarcube-3.0.6 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.5 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.4 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.3 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.2 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.1 spec/cocoa/nsattributedstring_spec.rb
sugarcube-3.0.0 spec/cocoa/nsattributedstring_spec.rb
sugarcube-2.12.3 spec/cocoa/nsattributedstring_spec.rb
sugarcube-2.12.2 spec/cocoa/nsattributedstring_spec.rb
sugarcube-2.12.1 spec/cocoa/nsattributedstring_spec.rb
sugarcube-2.12.0 spec/cocoa/nsattributedstring_spec.rb
sugarcube-2.11.1 spec/cocoa/nsattributedstring_spec.rb