From ee49501c6cb549ca415d78c0463b370d7d0cb9aa Mon Sep 17 00:00:00 2001 From: Graham Paye Date: Mon, 26 Nov 2018 13:22:07 -0800 Subject: [PATCH] fix windows test failures (#736) --- lib/google/api_client/client_secrets.rb | 2 +- spec/fixtures/files/test.txt | 2 +- spec/google/apis/core/upload_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/google/api_client/client_secrets.rb b/lib/google/api_client/client_secrets.rb index 76f270b6c..568356ebf 100644 --- a/lib/google/api_client/client_secrets.rb +++ b/lib/google/api_client/client_secrets.rb @@ -62,7 +62,7 @@ module Google search_path ||= File.expand_path('.') if File.exists?(File.join(search_path, 'client_secrets.json')) filename = File.join(search_path, 'client_secrets.json') - elsif search_path == '/' || search_path =~ /[a-zA-Z]:[\/\\]/ + elsif search_path == File.expand_path('..', search_path) raise ArgumentError, 'No client_secrets.json filename supplied ' + 'and/or could not be found in search path.' diff --git a/spec/fixtures/files/test.txt b/spec/fixtures/files/test.txt index 802992c42..70c379b63 100644 --- a/spec/fixtures/files/test.txt +++ b/spec/fixtures/files/test.txt @@ -1 +1 @@ -Hello world +Hello world \ No newline at end of file diff --git a/spec/google/apis/core/upload_spec.rb b/spec/google/apis/core/upload_spec.rb index 6e338a15d..de0cf1571 100644 --- a/spec/google/apis/core/upload_spec.rb +++ b/spec/google/apis/core/upload_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Google::Apis::Core::RawUploadCommand do it 'should send content' do command.execute(client) expect(a_request(:post, 'https://www.googleapis.com/zoo/animals') - .with(body: "Hello world\n")).to have_been_made + .with(body: "Hello world")).to have_been_made end it 'should send upload protocol' do @@ -52,7 +52,7 @@ RSpec.describe Google::Apis::Core::RawUploadCommand do end context('with StringIO input') do - let(:file) { StringIO.new("Hello world\n") } + let(:file) { StringIO.new("Hello world") } include_examples 'should upload' end @@ -68,7 +68,7 @@ RSpec.describe Google::Apis::Core::RawUploadCommand do context('with Tempfile input') do let(:file) do temp_file = Tempfile.new("tempfile") - temp_file.write("Hello world\n") + temp_file.write("Hello world") temp_file.rewind temp_file end