Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Nov 27, 2014
1 parent f0d9173 commit 8df57fb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
15 changes: 0 additions & 15 deletions library/general/src/lib/installation/proposal_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,5 @@ def ask_user(attrs)
def description
raise NotImplementedError, "Calling abstract method 'description'"
end

# Optional abstract method to write the proposed (and probably modified)
# settings to the system.
#
# It is up to the proposal dispatcher how it remembers the settings.
# The errors must be reported using the {Yast::ReportClass Report} class
# to have the possibility to control the behaviour from the main program.
#
# @return [Boolean] `true` if the settings were written successfully.
#
def write(attrs)
log.error "Write called, but proposal do not implement it"

nil
end
end
end
21 changes: 0 additions & 21 deletions library/general/test/proposal_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,5 @@ def write(args)
expect{::Installation::ProposalClient.run}.to raise_error(NotImplementedError)
end
end

context "first client argument is Write" do
before do
allow(Yast::WFM).to receive(:Args).and_return(["Write", {}])
end

it "dispatch call to abstract method write" do
expect(subject.run).to eq "write"
end

it "passes argument hash to abstract method" do
test_params = { :a => :b, :c => :d }
allow(Yast::WFM).to receive(:Args).and_return(["Write", test_params])

expect(subject.run).to eq test_params
end

it "just log error if abstract method not defined" do
expect{::Installation::ProposalClient.run}.to_not raise_error
end
end
end
end

0 comments on commit 8df57fb

Please sign in to comment.