Skip to content

Commit

Permalink
use better argument type
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 26, 2014
1 parent 9f17e92 commit f6504a6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library/general/src/lib/installation/auto_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def run
when "SetModified"
modified
else
raise "Invalid action for auto client '#{func.inspect}'"
raise ArgumentError, "Invalid action for auto client '#{func.inspect}'"
end
end

Expand Down
2 changes: 1 addition & 1 deletion library/general/src/lib/installation/finish_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run
when "Write"
write
else
raise "Invalid action for proposal '#{func.inspect}'"
raise ArgumentError, "Invalid action for proposal '#{func.inspect}'"
end
end

Expand Down
2 changes: 1 addition & 1 deletion library/general/src/lib/installation/proposal_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def run
when "Write"
write(param)
else
raise "Invalid action for proposal '#{func.inspect}'"
raise ArgumentError, "Invalid action for proposal '#{func.inspect}'"
end
end

Expand Down
4 changes: 2 additions & 2 deletions library/general/test/auto_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def import(args)
describe ::Installation::AutoClient do
subject { ::TestAuto }
describe ".run" do
it "raise exception if unknown first argument is passed" do
it "raise ArgumentError exception if unknown first argument is passed" do
allow(Yast::WFM).to receive(:Args).and_return(["Unknown", {}])
expect{::Installation::AutoClient.run}.to raise_error
expect{::Installation::AutoClient.run}.to raise_error(ArgumentError)
end

context "first client argument is Import" do
Expand Down
4 changes: 2 additions & 2 deletions library/general/test/finish_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def write
describe ::Installation::FinishClient do
subject { ::TestFinish }
describe ".run" do
it "raise exception if unknown first argument is passed" do
it "raise ArgumentError exception if unknown first argument is passed" do
allow(Yast::WFM).to receive(:Args).and_return(["Unknown", {}])
expect{::Installation::ProposalClient.run}.to raise_error
expect{::Installation::FinishClient.run}.to raise_error(ArgumentError)
end

context "first client argument is Info" do
Expand Down
4 changes: 2 additions & 2 deletions library/general/test/proposal_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def write(args)
describe ::Installation::ProposalClient do
subject { ::TestProposal }
describe ".run" do
it "raise exception if unknown first argument is passed" do
it "raise ArgumentError exception if unknown first argument is passed" do
allow(Yast::WFM).to receive(:Args).and_return(["Unknown", {}])
expect{::Installation::ProposalClient.run}.to raise_error
expect{::Installation::ProposalClient.run}.to raise_error(ArgumentError)
end

context "first client argument is MakeProposal" do
Expand Down

0 comments on commit f6504a6

Please sign in to comment.