Skip to content

Commit

Permalink
Yum.repo should show correct name
Browse files Browse the repository at this point in the history
inspec#1390

Signed-off-by: Wei, He <weihe924stephen@gmail.com>
  • Loading branch information
Wing924-r committed Jan 4, 2017
1 parent 7bee971 commit 370269c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/resources/yum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def enabled?
return false if repo.nil?
info['status'] == 'enabled'
end

def to_s
"YumRepo #{shortname(info['id'])}"
end
end

# for compatability with serverspec
Expand Down
1 change: 1 addition & 0 deletions test/unit/resources/yum_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
extras = resource.repo('base-debuginfo/x86_64')
_(extras.exist?).must_equal true
_(extras.enabled?).must_equal false
_(extras.to_s).must_equal 'YumRepo base-debuginfo'
end

it 'test enabled extra repo (serverspec backwards comptability)' do
Expand Down

0 comments on commit 370269c

Please sign in to comment.