Skip to content

Conversation

@piotrekbator
Copy link

@piotrekbator piotrekbator commented Feb 23, 2017

Complete with spec and Readme updates :)

api = Blanket::wrap("http://api.example.org", basic_auth: basic_auth)
api.users(55).get

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [111/80]

end

it 'allows setting parameters globally' do
api = Blanket::wrap("http://api.example.org", basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use :: for method calls.

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)
end

it 'allows setting parameters globally' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

it 'allows sending parameters in a request' do
api.users(55).get(basic_auth: basic_auth)

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [111/80]

allow(HTTParty).to receive(:get) { StubbedResponse.new }
end

it 'allows sending parameters in a request' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end

describe 'Basic Auth' do
let(:basic_auth) { {username: 'foo', password: 'bar'} }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside { missing.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Space inside } missing.

end
end

describe 'Basic Auth' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 98.208% when pulling e4684de on nibynic:master into 4f12b4a on inf0rmer:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 98.929% when pulling aeed09e on nibynic:master into 4f12b4a on inf0rmer:master.

@lazebny
Copy link

lazebny commented Apr 22, 2017

Would be nice to have this feature in master.

api = Blanket::wrap("http://api.example.org", basic_auth: basic_auth)
api.users(55).get

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [111/80]

end

it 'allows setting parameters globally' do
api = Blanket::wrap("http://api.example.org", basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/ColonMethodCall: Do not use :: for method calls.

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)
end

it 'allows setting parameters globally' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

it 'allows sending parameters in a request' do
api.users(55).get(basic_auth: basic_auth)

expect(HTTParty).to have_received(:get).with('http://api.example.org/users/55', basic_auth: basic_auth)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Metrics/LineLength: Line is too long. [111/80]

allow(HTTParty).to receive(:get) { StubbedResponse.new }
end

it 'allows sending parameters in a request' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end

describe 'Basic Auth' do
let(:basic_auth) { {username: 'foo', password: 'bar'} }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideHashLiteralBraces: Space inside { missing.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

end
end

describe 'Basic Auth' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@rpbaltazar
Copy link

Why has this never made it to master? Is there any more up to date gem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants