Projects
Factory:RISC-V:Ruby
rubygem-contracts
_service:tar_scm:rubygem-contracts-0.16.0-0002-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:rubygem-contracts-0.16.0-0002-Update-spec-to-specify-error-class-to-suppress-RSpec.patch of Package rubygem-contracts
From 85c6a4e471f2013079dc5a63c1a6bb84bee9351b Mon Sep 17 00:00:00 2001 From: PikachuEXE <pikachuexe@gmail.com> Date: Mon, 25 Jan 2021 17:26:45 +0800 Subject: [PATCH 2/5] * Update spec to specify error class to suppress RSpec warning --- spec/contracts_spec.rb | 6 +++--- spec/methods_spec.rb | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/contracts_spec.rb b/spec/contracts_spec.rb index d37c40e..72c8603 100644 --- a/spec/contracts_spec.rb +++ b/spec/contracts_spec.rb @@ -7,7 +7,7 @@ RSpec.describe "Contracts:" do it "should fail for insufficient arguments" do expect do @o.hello - end.to raise_error + end.to raise_error ArgumentError end it "should fail for insufficient contracts" do @@ -32,7 +32,7 @@ RSpec.describe "Contracts:" do 1 end end - end.to raise_error + end.to raise_error NameError end end @@ -696,7 +696,7 @@ RSpec.describe "Contracts:" do it "should apply the contract to an inherited method" do c = Child.new expect { c.double(2) }.to_not raise_error - expect { c.double("asd") }.to raise_error + expect { c.double("asd") }.to raise_error ParamContractError end end diff --git a/spec/methods_spec.rb b/spec/methods_spec.rb index 334fb4e..d1b5d47 100644 --- a/spec/methods_spec.rb +++ b/spec/methods_spec.rb @@ -36,19 +36,19 @@ RSpec.describe "Contracts:" do end it "should enforce return value inside block with no other parameter" do - expect { obj.foo(&:to_s) }.to raise_error + expect { obj.foo(&:to_s) }.to raise_error ReturnContractError end it "should enforce return value inside block with other parameter" do - expect { obj.foo2(2) { |x| x.to_s } }.to raise_error + expect { obj.foo2(2) { |x| x.to_s } }.to raise_error ReturnContractError end it "should enforce return value inside lambda with no other parameter" do - expect { obj.bar lambda { |x| x.to_s } }.to raise_error + expect { obj.bar lambda { |x| x.to_s } }.to raise_error ReturnContractError end it "should enforce return value inside lambda with other parameter" do - expect { obj.bar2(2, lambda { |x| x.to_s }) }.to raise_error + expect { obj.bar2(2, lambda { |x| x.to_s }) }.to raise_error ReturnContractError end end end -- 2.29.2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2