Skip to content

Commit

Permalink
(PUP-11634) Mark pending tests due to rspec 3.12 and Ruby 3.2 kwarg c…
Browse files Browse the repository at this point in the history
…onfusion

Ruby 3.2.0 preview2 broke how rspec 3.12 detects if a method takes keyword
arguments or hashes[1]. For now, mark the tests as pending.

[1] rspec/rspec-mocks#1495
  • Loading branch information
joshcooper committed Dec 5, 2022
1 parent c2e5c97 commit a38047c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/unit/http/resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
end

it 'uses the provided ssl context during resolution' do
pending("https://github.com/rspec/rspec-mocks/issues/1495") if RUBY_VERSION.to_f >= 3.2

stub_request(:get, "https://ca.example.com:8141/status/v1/simple/server").to_return(status: 200)

other_ctx = Puppet::SSL::SSLContext.new
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/http/service/puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
end

it 'accepts an ssl context' do
pending("https://github.com/rspec/rspec-mocks/issues/1495") if RUBY_VERSION.to_f >= 3.2

stub_request(:get, url)
.to_return(body: "running", headers: {'Content-Type' => 'text/plain;charset=utf-8'})

Expand Down
4 changes: 4 additions & 0 deletions spec/unit/http/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ def mime_types(model)
end

it "connects to the base URL with a nil ssl context" do
pending("https://github.com/rspec/rspec-mocks/issues/1495") if RUBY_VERSION.to_f >= 3.2

expect(client).to receive(:connect).with(url, options: {ssl_context: nil})

service.connect
end

it "accepts an optional ssl_context" do
pending("https://github.com/rspec/rspec-mocks/issues/1495") if RUBY_VERSION.to_f >= 3.2

other_ctx = Puppet::SSL::SSLContext.new
expect(client).to receive(:connect).with(url, options: {ssl_context: other_ctx})

Expand Down
2 changes: 2 additions & 0 deletions spec/unit/reports/http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
end

it "passes metric_id options" do
pending("https://github.com/rspec/rspec-mocks/issues/1495") if RUBY_VERSION.to_f >= 3.2

stub_request(:post, url)

expect(Puppet.runtime[:http]).to receive(:post).with(anything, anything, hash_including(options: hash_including(metric_id: [:puppet, :report, :http]))).and_call_original
Expand Down

0 comments on commit a38047c

Please sign in to comment.