Skip to content

Commit

Permalink
Merge pull request #584 from yast/rspec-kw-hash
Browse files Browse the repository at this point in the history
Fix hash vs keyword arguments in RSpec expectations (bsc#1204871)
  • Loading branch information
mvidner authored Oct 31, 2022
2 parents 0fb5897 + 5b52161 commit 0d7fdc1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions package/yast2-registration.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 31 10:14:45 UTC 2022 - Martin Vidner <mvidner@suse.com>

- Fix hash vs keyword arguments in RSpec expectations (bsc#1204871)
- 4.5.8

-------------------------------------------------------------------
Tue Oct 25 12:19:45 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-registration.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 4.5.7
Version: 4.5.8
Release: 0
Summary: YaST2 - Registration Module
License: GPL-2.0-only
Expand Down
9 changes: 5 additions & 4 deletions test/helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,15 @@
describe ".write_config" do
it "writes the current configuration" do
url = "https://example.com"
config = {
url: url,
insecure: false
}
expect(Registration::UrlHelpers).to receive(:registration_url) \
.and_return(url)
expect(Registration::Helpers).to receive(:insecure_registration) \
.and_return(false)
expect(SUSE::Connect::YaST).to receive(:write_config).with(
url: url,
insecure: false
)
expect(SUSE::Connect::YaST).to receive(:write_config).with(config)

Registration::Helpers.write_config
end
Expand Down
8 changes: 5 additions & 3 deletions test/registration/clients/scc_auto_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
end

it "imports given hash" do
expect(config).to receive(:import).with("reg_code" => "SOME-CODE")
subject.import("reg_code" => "SOME-CODE")
settings = { "reg_code" => "SOME-CODE" }
expect(config).to receive(:import).with(settings)
subject.import(settings)
end

context "when the registration code is not specified" do
Expand All @@ -65,7 +66,8 @@
end

it "reads the code from the registration codes loader" do
expect(config).to receive(:import).with("reg_code" => "INTERNAL-USE-ONLY")
imported = { "reg_code" => "INTERNAL-USE-ONLY" }
expect(config).to receive(:import).with(imported)
subject.import({})
end

Expand Down
3 changes: 2 additions & 1 deletion test/registration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
receive(:registered)

# the received product renames are passed to the software management
renames = { "SUSE_SLES_SAP" => "SLES_SAP" }
expect(Registration::SwMgmt).to receive(:update_product_renames)
.with("SUSE_SLES_SAP" => "SLES_SAP")
.with(renames)

allow(SUSE::Connect::YaST).to receive(:credentials)
.with(SUSE::Connect::YaST::GLOBAL_CREDENTIALS_FILE)
Expand Down

0 comments on commit 0d7fdc1

Please sign in to comment.