We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f30227f commit 4aeb34fCopy full SHA for 4aeb34f
spec/fcm_spec.rb
@@ -1,4 +1,5 @@
1
require "spec_helper"
2
+require 'tempfile'
3
4
describe FCM do
5
let(:project_name) { 'test-project' }
@@ -75,6 +76,14 @@
75
76
it 'can be an IO object' do
77
fcm = FCM.new(StringIO.new('hey'))
78
expect(fcm.__send__(:json_key).class).to eq(StringIO)
79
+
80
+ temp_file = Tempfile.new('hello_world.json')
81
+ temp_file.write(json_credentials)
82
+ fcm_with_temp_file = FCM.new(temp_file)
83
84
+ expect { fcm_with_temp_file.__send__(:json_key) }.not_to raise_error(creds_error)
85
+ temp_file.close
86
+ temp_file.unlink
87
end
88
89
it 'raises an error when passed a non IO-like object' do
0 commit comments