Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'its(:property)' syntax to test property of Solaris service #511

Merged
merged 1 commit into from
Mar 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/serverspec/type/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,20 @@ def monitored_by?(monitor)
def has_property?(property)
@runner.check_service_has_property(@name, property)
end

def property
get_property if @property.nil?
@property
end

private
def get_property
@property = {}
props = @runner.get_service_property(@name).stdout
props.split(/\n/).each do |line|
property, _type, *value = line.split(/\s+/)
@property[property] = value.join(' ')
end
end
end
end