spec/groupdocs/document/annotation/reply_spec.rb in groupdocs-1.2.11 vs spec/groupdocs/document/annotation/reply_spec.rb in groupdocs-1.3.0

- old
+ new

@@ -4,49 +4,49 @@ it_behaves_like GroupDocs::Api::Entity subject do file = GroupDocs::Storage::File.new - document = GroupDocs::Document.new(file: file) - annotation = GroupDocs::Document::Annotation.new(document: document) - described_class.new(annotation: annotation) + document = GroupDocs::Document.new(:file => file) + annotation = GroupDocs::Document::Annotation.new(:document => document) + described_class.new(:annotation => annotation) end describe '.get!' do before(:each) do mock_api_server(load_json('annotation_replies_get')) end let(:annotation) do - document = GroupDocs::Document.new(file: GroupDocs::Storage::File.new) - GroupDocs::Document::Annotation.new(document: document) + document = GroupDocs::Document.new(:file => GroupDocs::Storage::File.new) + GroupDocs::Document::Annotation.new(:document => document) end it 'accepts access credentials hash' do lambda do - described_class.get!(annotation, {}, client_id: 'client_id', private_key: 'private_key') + described_class.get!(annotation, {}, :client_id => 'client_id', :private_key => 'private_key') end.should_not raise_error(ArgumentError) end it 'accepts options hash' do lambda do - described_class.get!(annotation, after: Time.now) + described_class.get!(annotation, :after => Time.now) end.should_not raise_error(ArgumentError) end it 'raises error if annotation is not an instance of GroupDocs::Document::Annotation' do - -> { described_class.get!('Annotation') }.should raise_error(ArgumentError) + lambda { described_class.get!('Annotation') }.should raise_error(ArgumentError) end it 'raises error if option :after is not an instance of Time' do - -> { described_class.get!(annotation, after: 'Yesterday') }.should raise_error(ArgumentError) + lambda { described_class.get!(annotation, :after => 'Yesterday') }.should raise_error(ArgumentError) end it 'converts option :after to Unix timestamp' do time = Time.now time.should_receive(:to_i).and_return(1334125808) - described_class.get!(annotation, after: time) + described_class.get!(annotation, :after => time) end it 'returns an array of GroupDocs::Document::Annotation::Reply objects' do replies = described_class.get!(annotation) replies.should be_an(Array) @@ -72,15 +72,15 @@ it { should have_alias(:replied_on=, :repliedOn=) } describe '#initialize' do it 'raises error if annotation is not specified' do - -> { described_class.new }.should raise_error(ArgumentError) + lambda { described_class.new }.should raise_error(ArgumentError) end it 'raises error if annotation is not an instance of GroupDocs::Document::Annotation' do - -> { described_class.new(annotation: '') }.should raise_error(ArgumentError) + lambda { described_class.new(:annotation => '') }.should raise_error(ArgumentError) end end describe '#replied_on' do it 'returns converted to Time object Unix timestamp' do @@ -94,11 +94,11 @@ mock_api_server(load_json('annotation_replies_create')) end it 'accepts access credentials hash' do lambda do - subject.create!(client_id: 'client_id', private_key: 'private_key') + subject.create!(:client_id => 'client_id', :private_key => 'private_key') end.should_not raise_error(ArgumentError) end it 'gets annotation guid' do subject.should_receive(:get_annotation_guid) @@ -120,11 +120,11 @@ mock_api_server('{ "result": {}, "status": "Ok" }') end it 'accepts access credentials hash' do lambda do - subject.edit!(client_id: 'client_id', private_key: 'private_key') + subject.edit!(:client_id => 'client_id', :private_key => 'private_key') end.should_not raise_error(ArgumentError) end end describe '#remove!' do @@ -132,10 +132,10 @@ mock_api_server('{ "result": {}, "status": "Ok" }') end it 'accepts access credentials hash' do lambda do - subject.remove!(client_id: 'client_id', private_key: 'private_key') + subject.remove!(:client_id => 'client_id', :private_key => 'private_key') end.should_not raise_error(ArgumentError) end end describe '#get_annotation_guid' do