spec/groupdocs/storage/folder_spec.rb in groupdocs-1.9.0 vs spec/groupdocs/storage/folder_spec.rb in groupdocs-2.0.0
- old
+ new
@@ -11,11 +11,11 @@
end
it 'accepts access credentials hash' do
lambda do
described_class.create!('Test', :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'returns GroupDocs::Storage::Folder object' do
folder = described_class.create!('Test')
folder.should be_a(GroupDocs::Storage::Folder)
@@ -28,23 +28,23 @@
end
it 'accepts access credentials hash' do
lambda do
described_class.list!('', {}, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'allows passing path' do
- lambda { described_class.list!('test') }.should_not raise_error(ArgumentError)
+ lambda { described_class.list!('test') }.should_not raise_error()
end
it 'allows passing options' do
- lambda { described_class.list!('', :page => 1, :count => 1) }.should_not raise_error(ArgumentError)
+ lambda { described_class.list!('', :page => 1, :count => 1) }.should_not raise_error()
end
it 'creates new instance of GroupDocs::Storage::Folder and calls #list!' do
- folder = stub('folder')
+ folder = double('folder')
GroupDocs::Storage::Folder.should_receive(:new).with(:path => '').and_return(folder)
folder.should_receive(:list!).with({}, {})
described_class.list!
end
end
@@ -81,15 +81,15 @@
end
it 'accepts access credentials hash' do
lambda do
subject.list!({}, :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'allows passing options' do
- lambda { subject.list!(:page => 1, :count => 1) }.should_not raise_error(ArgumentError)
+ lambda { subject.list!(:page => 1, :count => 1) }.should_not raise_error()
end
it 'capitalizes :order_by option' do
options = { :order_by => 'field' }
lambda { subject.list!(options) }.should change { options[:order_by] }.to('Field')
@@ -129,11 +129,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.move!('Test', :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'returns moved to folder path' do
moved = subject.move!('Test2/Test1')
moved.should be_a(String)
@@ -148,11 +148,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.copy!('/Test2', :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'returns moved to folder path' do
moved = subject.copy!('Test2/Test1')
moved.should be_a(String)
@@ -166,11 +166,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.create!(:client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'calls create! class method and pass parameters to it' do
subject = described_class.new(:name => 'Test1')
described_class.should_receive(:create!).with('Test1', {})
@@ -191,11 +191,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.delete!(:client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'determines path by name' do
subject.should_receive(:name).and_return('Test1')
subject.delete!
@@ -208,11 +208,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.sharers!(:client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'returns an array of GroupDocs::User objects' do
users = subject.sharers!
users.should be_an(Array)
@@ -228,11 +228,11 @@
end
it 'accepts access credentials hash' do
lambda do
subject.sharers_set!(%w(test1@email.com), :client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'returns an array of GroupDocs::User objects' do
users = subject.sharers_set!(%w(test1@email.com))
users.should be_an(Array)
@@ -258,10 +258,10 @@
end
it 'accepts access credentials hash' do
lambda do
subject.sharers_clear!(:client_id => 'client_id', :private_key => 'private_key')
- end.should_not raise_error(ArgumentError)
+ end.should_not raise_error()
end
it 'clears sharers list and returns nil' do
subject.sharers_clear!.should be_nil
end