Skip to content

Commit 0ccde13

Browse files
committed
update github workflow
1 parent c6dae53 commit 0ccde13

File tree

2 files changed

+13
-36
lines changed

2 files changed

+13
-36
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ jobs:
2323

2424
- name: Run RSpec
2525
env:
26-
PATCH_RUBY_HOST: 'https://api.staging-patch.com/'
27-
PATCH_RUBY_API_KEY: 'key_test_1234'
26+
PATCH_RUBY_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
2827
run: bundle exec rspec
29-

spec/api_client_spec.rb

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,22 @@
1010
1111
=end
1212

13-
require 'spec_helper'
14-
1513
describe Patch::ApiClient do
1614
context 'initialization' do
17-
context 'URL stuff' do
18-
context 'host' do
19-
it 'removes http from host' do
20-
Patch.configure { |c| c.host = 'http://example.com' }
21-
expect(Patch::Configuration.default.host).to eq('example.com')
22-
end
23-
24-
it 'removes https from host' do
25-
Patch.configure { |c| c.host = 'https://wookiee.com' }
26-
expect(Patch::ApiClient.default.config.host).to eq('wookiee.com')
27-
end
28-
29-
it 'removes trailing path from host' do
30-
Patch.configure { |c| c.host = 'hobo.com/v4' }
31-
expect(Patch::Configuration.default.host).to eq('hobo.com')
32-
end
15+
context 'base_path' do
16+
it "prepends a slash to base_path" do
17+
Patch.configure { |c| c.base_path = 'v4/dog' }
18+
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
19+
end
20+
21+
it "doesn't prepend a slash if one is already there" do
22+
Patch.configure { |c| c.base_path = '/v4/dog' }
23+
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
3324
end
3425

35-
context 'base_path' do
36-
it "prepends a slash to base_path" do
37-
Patch.configure { |c| c.base_path = 'v4/dog' }
38-
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
39-
end
40-
41-
it "doesn't prepend a slash if one is already there" do
42-
Patch.configure { |c| c.base_path = '/v4/dog' }
43-
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
44-
end
45-
46-
it "ends up as a blank string if nil" do
47-
Patch.configure { |c| c.base_path = nil }
48-
expect(Patch::Configuration.default.base_path).to eq('')
49-
end
26+
it "ends up as a blank string if nil" do
27+
Patch.configure { |c| c.base_path = nil }
28+
expect(Patch::Configuration.default.base_path).to eq('')
5029
end
5130
end
5231
end

0 commit comments

Comments
 (0)