Skip to content

Commit

Permalink
Refs #29991 - Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren committed May 2, 2024
1 parent 5c0ff1e commit 089d649
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/models/token/puppetca_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class Token::PuppetcaTest < ActiveSupport::TestCase
class Token::PuppetCATest < ActiveSupport::TestCase
should validate_uniqueness_of(:value)

let(:host) { FactoryBot.create(:host) }
Expand Down
10 changes: 5 additions & 5 deletions test/unit/foreman/http_proxy_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class HttpProxyTest < ActiveSupport::TestCase
class Foreman::HttpProxyTest < ActiveSupport::TestCase
class DummyHttpAdapter
include Foreman::HttpProxy
end
Expand Down Expand Up @@ -106,10 +106,10 @@ class DummyHttpAdapter
end

describe 'Excon::Connection extension' do
let(:excon_connection) { Excon::Connection.new }
let(:excon_connection) { ::Excon::Connection.new }

setup do
Excon::Connection.class_eval { prepend Foreman::HttpProxy::ExconConnectionExtension } if Excon::Connection.ancestors.first != Foreman::HttpProxy::ExconConnectionExtension
::Excon::Connection.class_eval { prepend Foreman::HttpProxy::ExconConnectionExtension } if ::Excon::Connection.ancestors.first != Foreman::HttpProxy::ExconConnectionExtension
excon_connection.stubs(:http_proxy).returns(http_proxy)
excon_connection.stubs(:setup_proxy).returns
excon_connection.stubs(:proxy_http_request?).returns(true)
Expand All @@ -123,7 +123,7 @@ class DummyHttpAdapter

test 'rescues requests and mentions proxy' do
stub_request(:get, "http://#{request_host}/features").to_raise("AnException")
assert_raises_with_message Excon::Error::Socket, "AnException" do
assert_raises_with_message ::Excon::Error::Socket, "AnException" do
excon_connection.request({host: request_host, path: "/features", headers: {}})
end
end
Expand All @@ -145,7 +145,7 @@ class DummyHttpAdapter
test 'rescues requests and mentions proxy' do
stub_request(:get, "http://#{request_host}/features")
assert_raises_with_message StandardError.new, "Failed to open TCP connection" do
net_http.request(Net::HTTP::Get.new("/features"))
net_http.request(::Net::HTTP::Get.new("/features"))
end
end
end
Expand Down
1 change: 0 additions & 1 deletion test/unit/net/dhcp_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test_helper'
require 'net'

class DHCPTest < ActiveSupport::TestCase
setup do
Expand Down
2 changes: 0 additions & 2 deletions test/unit/net/dns_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'test_helper'
require 'net'
require 'net/dns'

class DNSTest < ActiveSupport::TestCase
setup do
Expand Down
1 change: 0 additions & 1 deletion test/unit/net/net_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test_helper'
require 'net'

class NetTest < ActiveSupport::TestCase
test "Net record should auto assign attributes" do
Expand Down
1 change: 0 additions & 1 deletion test/unit/net/validations_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test_helper'
require 'net'

class ValidationsTest < ActiveSupport::TestCase
describe "validate_mac" do
Expand Down

0 comments on commit 089d649

Please sign in to comment.