Sha256: 390a641afa351e4a26ce8ed709483b66feb6d03ccde2e9d59b4567c35682f892

Contents?: true

Size: 1 KB

Versions: 22

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe GroupDocs::Document::Field do

  it_behaves_like GroupDocs::Api::Entity

  it { should respond_to(:page)        }
  it { should respond_to(:page=)       }
  it { should respond_to(:name)        }
  it { should respond_to(:name=)       }
  it { should respond_to(:type)        }
  it { should respond_to(:type=)       }
  it { should respond_to(:rectangle)   }
  it { should respond_to(:rectangle=)  }

  it 'is compatible with response JSON' do
    subject.should respond_to(:rect=)
    subject.method(:rect=).should == subject.method(:rectangle=)
  end

  describe '#rectangle=' do
    it 'converts passed hash to GroupDocs::Document::Rectangle object' do
      subject.rectangle = { 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
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
groupdocs-0.3.11 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.10 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.9 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.8 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.7 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.6 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.5 spec/groupdocs/document/field_spec.rb
groupdocs-0.3.0 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.11 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.10 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.9 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.8 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.7 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.6 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.5 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.4 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.3 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.2 spec/groupdocs/document/field_spec.rb
groupdocs-0.2.1 spec/groupdocs/document/field_spec.rb
groupdocs-0.2 spec/groupdocs/document/field_spec.rb