spec/cli/resource_spec.rb in apigee_cli-0.0.2 vs spec/cli/resource_spec.rb in apigee_cli-0.0.3
- old
+ new
@@ -68,9 +68,19 @@
expect(resource.shell.printed).to eq [
"Deleting current resource for test.js",
"Deleting current resource for test2.js"
]
end
+
+ specify 'when --name is specified, it only uploads that file to the Apigee server' do
+ resource = Resource.new([], folder: File.expand_path('../fixtures', __dir__), name: 'test.js')
+ resource.shell = ShellRecorder.new
+ allow_any_instance_of(ApigeeCli::ResourceFile).to receive(:upload).and_return(:new_file)
+
+ resource.invoke(:upload)
+
+ expect(resource.shell.printed).to eq ["Creating resource for test.js"]
+ end
end
describe 'apigee resource delete' do
it 'requires the --name of the file to delete' do
resource = Resource.new([])