Skip to content

Commit

Permalink
Update from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs authored and joseivanlopez committed Aug 6, 2018
1 parent 47d657d commit 37f8d48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions library/system/src/lib/yast2/system_service.rb
Expand Up @@ -56,6 +56,16 @@ class SystemService
# underlying system.
attr_reader :errors

# @!method state
#
# @return [String]
def_delegator :@service, :active_state, :state

# @!method substate
#
# @return [String]
def_delegator :@service, :sub_state, :substate

def_delegators :@service, :running?, :start, :stop, :restart, :active?,
:active_state, :sub_state, :name, :description, :static?

Expand Down
4 changes: 2 additions & 2 deletions library/system/test/yast2/system_service_test.rb
Expand Up @@ -391,7 +391,7 @@
it "does not register any error" do
allow(service).to receive(:start).and_return(true)
system_service.save
expect(system_service.errors).to_not have_key(:activate)
expect(system_service.errors).to_not have_key(:active)
end
end

Expand Down Expand Up @@ -430,7 +430,7 @@
it "does not register any error" do
allow(service).to receive(:stop).and_return(true)
system_service.save
expect(system_service.errors).to_not have_key(:activate)
expect(system_service.errors).to_not have_key(:active)
end
end

Expand Down

0 comments on commit 37f8d48

Please sign in to comment.