spec/lib/chatwork/client_spec.rb in chatwork-0.5.0 vs spec/lib/chatwork/client_spec.rb in chatwork-0.6.0
- old
+ new
@@ -1,34 +1,34 @@
describe ChatWork::Client do
- describe '#initialize' do
+ describe "#initialize" do
subject { ChatWork::Client.new(api_key, access_token, api_base, api_version) }
let(:api_key) { nil }
let(:access_token) { nil }
- let(:api_base) { 'https://api.chatwork.com/' }
- let(:api_version) { '/v2' }
+ let(:api_base) { "https://api.chatwork.com/" }
+ let(:api_version) { "/v2" }
- context 'with api_key' do
- let(:api_key) { 'my_api_key' }
+ context "with api_key" do
+ let(:api_key) { "my_api_key" }
- it 'client has X-ChatWorkToken header' do
+ it "client has X-ChatWorkToken header" do
connection = subject.instance_variable_get(:@conn)
- expect(connection.headers['X-ChatWorkToken']).to eq "my_api_key"
+ expect(connection.headers["X-ChatWorkToken"]).to eq "my_api_key"
end
end
- context 'with access_token' do
- let(:access_token) { 'my_access_token' }
+ context "with access_token" do
+ let(:access_token) { "my_access_token" }
- it 'client has Authorization header' do
+ it "client has Authorization header" do
connection = subject.instance_variable_get(:@conn)
- expect(connection.headers['Authorization']).to eq "Bearer my_access_token"
+ expect(connection.headers["Authorization"]).to eq "Bearer my_access_token"
end
end
- context 'without both api_key and access_token' do
- it { expect { subject }.to raise_error 'Either api_key or access_token is required' }
+ context "without both api_key and access_token" do
+ it { expect { subject }.to raise_error "Either api_key or access_token is required" }
end
end
-end
\ No newline at end of file
+end