Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for newer versions of mocha #47

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/ad_provider_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_rebuild_host_returns_password
end

def test_generate_password_returns_random_passwords
assert_not_equal @provider.generate_password, @provider.generate_password
refute_equal @provider.generate_password, @provider.generate_password
end

def test_generate_password_returns_20_char_long_password
Expand All @@ -83,22 +83,22 @@ def test_generate_password_returns_20_char_long_password

def test_apply_computername_prefix_should_return_false_when_prefix_is_nil
provider = Proxy::AdRealm::Provider.new(computername_prefix: nil, realm: 'example.com')
assert_false provider.apply_computername_prefix?('host.example.com')
refute provider.apply_computername_prefix?('host.example.com')
end

def test_apply_computername_prefix_should_return_false_when_prefix_is_empty
provider = Proxy::AdRealm::Provider.new(computername_prefix: '', realm: 'example.com')
assert_false provider.apply_computername_prefix?('host.example.com')
refute provider.apply_computername_prefix?('host.example.com')
end

def test_apply_computername_prefix_should_return_false_when_hostname_contains_prefix
provider = Proxy::AdRealm::Provider.new(computername_prefix: 'PREFIX-', realm: 'example.com')
assert_false provider.apply_computername_prefix?('prefix-host.example.com')
refute provider.apply_computername_prefix?('prefix-host.example.com')
end

def test_apply_computername_prefix_should_return_true_when_computername_hash_is_used
provider = Proxy::AdRealm::Provider.new(computername_prefix: 'PREFIX-', computername_hash: true, realm: 'example.com')
assert_true provider.apply_computername_prefix?('host.example.com')
assert provider.apply_computername_prefix?('host.example.com')
end

def test_hostfqdn_to_computername_uses_prefix
Expand All @@ -121,7 +121,7 @@ def test_unrecognized_realm_raises_exception
end

def test_find
assert_true @provider.find('a_host_fqdn')
assert @provider.find('a_host_fqdn')
end

def test_delete
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require 'test/unit'
require 'mocha/setup'
require 'mocha/test_unit'

require 'smart_proxy_for_testing'

Expand Down
Loading