Sha256: 9804a5b0465d7f0ff79e7f24934effc187621bb263be45ecdc693e0904a8e4fa

Contents?: true

Size: 862 Bytes

Versions: 22

Compression:

Stored size: 862 Bytes

Contents

require 'spec_helper'

describe GroupDocs::Document::Field do
  it_behaves_like GroupDocs::Api::Entity

  it { should have_accessor(:page) }
  it { should have_accessor(:name) }
  it { should have_accessor(:type) }
  it { should have_accessor(:rect) }

  describe '#rect=' do
    it 'converts passed hash to GroupDocs::Document::Rectangle object' do
      subject.rect = { :x => 0.90, :y => 0.05, :width => 0.06745, :height => 0.005967 }
      subject.rectangle.should be_a(GroupDocs::Document::Rectangle)
      subject.rectangle.x.should == 0.90
      subject.rectangle.y.should == 0.05
      subject.rectangle.w.should == 0.06745
      subject.rectangle.h.should == 0.005967
    end

    it 'does nothing when nil is passed' do
      subject.rect = nil
      subject.rectangle.should be_nil
    end
  end

  it { should alias_accessor(:rectangle, :rect) }
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
groupdocs-2.2.0 spec/groupdocs/document/field_spec.rb
groupdocs-2.1.0 spec/groupdocs/document/field_spec.rb
groupdocs-2.0.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.9.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.8.1 spec/groupdocs/document/field_spec.rb
groupdocs-1.8.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.7.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.6.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.9 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.8 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.7 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.6 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.5 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.4 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.3 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.2 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.1 spec/groupdocs/document/field_spec.rb
groupdocs-1.5.0 spec/groupdocs/document/field_spec.rb
groupdocs-1.4.2 spec/groupdocs/document/field_spec.rb
groupdocs-1.4.1 spec/groupdocs/document/field_spec.rb