Skip to content

Commit 8309643

Browse files
committed
🚨 Linting
1 parent 0a04dc7 commit 8309643

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.rubocop_gradual.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lib/omniauth-ldap/adaptor.rb:3925200886": [
2+
"lib/omniauth-ldap/adaptor.rb:928056405": [
33
[68, 7, 413, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 105664470]
44
],
55
"spec/integration/middleware_spec.rb:2185613788": [
@@ -12,7 +12,7 @@
1212
[4, 3, 12, "RSpec/BeforeAfterAll: Beware of using `before(:all)` as it may cause state to leak between tests. If you are using `rspec-rails`, and `use_transactional_fixtures` is enabled, then records created in `before(:all)` are not automatically rolled back.", 86334566],
1313
[70, 16, 5, "RSpec/ExpectActual: Provide the actual value you are testing to `expect(...)`.", 237881235]
1414
],
15-
"spec/omniauth-ldap/adaptor_spec.rb:1245381318": [
15+
"spec/omniauth-ldap/adaptor_spec.rb:1839434473": [
1616
[3, 1, 38, "RSpec/SpecFilePathFormat: Spec path should end with `omni_auth/ldap/adaptor*_spec.rb`.", 1973618936],
1717
[239, 9, 26, "RSpec/StubbedMock: Prefer `allow` over `expect` when configuring a response.", 1924417310],
1818
[240, 9, 26, "RSpec/StubbedMock: Prefer `allow` over `expect` when configuring a response.", 1924417310]

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Please file a bug if you notice a violation of semantic versioning.
3232
- Support for JSON bodies
3333
- Support custom LDAP attributes mapping
3434
- Raise a distinct error when LDAP server is unreachable
35-
- Previously raised an invalid credentials authentication failure error, which is technically incorrect
35+
- Previously raised an invalid credentials authentication failure error, which is technically incorrect
3636

3737
### Changed
3838

spec/omniauth-ldap/adaptor_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ def mock_conn(opts = {})
311311
expect(adaptor.last_password_policy_response.oid).to eq(ppolicy_oid)
312312
end
313313

314-
it "should raise a ConnectionError if the bind fails" do
315-
adaptor = OmniAuth::LDAP::Adaptor.new({host: "192.168.1.126", method: 'plain', base: 'dc=score, dc=local', port: 389, uid: 'sAMAccountName', bind_dn: 'bind_dn', password: 'password'})
316-
expect(adaptor.connection).to receive(:open).and_yield(adaptor.connection)
314+
it "raises a ConnectionError if the bind fails" do
315+
adaptor = described_class.new({host: "192.168.1.126", method: "plain", base: "dc=score, dc=local", port: 389, uid: "sAMAccountName", bind_dn: "bind_dn", password: "password"})
316+
allow(adaptor.connection).to receive(:open).and_yield(adaptor.connection)
317317
# Net::LDAP#search returns nil if the operation was not successful
318-
expect(adaptor.connection).to receive(:search).with(args).and_return(nil)
318+
allow(adaptor.connection).to receive(:search).with(args).and_return(nil)
319319
expect(adaptor.connection).not_to receive(:bind)
320-
expect { adaptor.bind_as(args) }.to raise_error OmniAuth::LDAP::Adaptor::ConnectionError
320+
expect { adaptor.bind_as(args) }.to raise_error described_class::ConnectionError
321321
end
322322
end
323323
end

0 commit comments

Comments
 (0)