Sha256: 5fe0efadebfe0a3bbd238a2d7d7f395eb6307562e206b45de46e247ba5babeec

Contents?: true

Size: 839 Bytes

Versions: 6

Compression:

Stored size: 839 Bytes

Contents

require 'spec_helper'

describe GroupDocs::DataSource::Field do

  it_behaves_like GroupDocs::Api::Entity

  it { should respond_to(:name)   }
  it { should respond_to(:name=)  }
  it { should respond_to(:type)    }
  it { should respond_to(:type=)   }
  it { should respond_to(:values)  }
  it { should respond_to(:values=) }

  describe '#type=' do
    it 'saves type in machine readable format if symbol is passed' do
      subject.type = :binary
      subject.instance_variable_get(:@type).should == 'Binary'
    end

    it 'does nothing if parameter is not symbol' do
      subject.type = 'Binary'
      subject.instance_variable_get(:@type).should == 'Binary'
    end
  end

  describe '#type' do
    it 'returns type in human-readable format' do
      subject.type = 'Binary'
      subject.type.should == :binary
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
groupdocs-1.1.0 spec/groupdocs/datasource/field_spec.rb
groupdocs-1.0.0 spec/groupdocs/datasource/field_spec.rb
groupdocs-0.3.11 spec/groupdocs/datasource/field_spec.rb
groupdocs-0.3.10 spec/groupdocs/datasource/field_spec.rb
groupdocs-0.3.9 spec/groupdocs/datasource/field_spec.rb
groupdocs-0.3.8 spec/groupdocs/datasource/field_spec.rb