Sha256: b3d9a038f07333093c0a629e42d06853e80c155088d2b12c9635dec779f82e0c

Contents?: true

Size: 533 Bytes

Versions: 3

Compression:

Stored size: 533 Bytes

Contents

Given(/^the zpool "(.*?)" has a capacity of (\d+)%$/) do |name, capacity|
  cmd = "zpool list -H -o name,cap #{name}"
  out = "#{name}\t#{capacity}%\n"
  double_cmd(cmd, :puts => out)
end

Then(/^the status should be (unknown|critical|warning|ok)$/) do |status|
  exit_status =
    case status
    when 'unknown'  then 3
    when 'critical' then 2
    when 'warning'  then 1
    when 'ok'       then 0
    end
  steps %Q(
    Then the exit status should be #{exit_status}
    And the stdout should contain "#{status.upcase}"
  )
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nagios-zfs-0.1.1 features/step_definitions/dev_steps.rb
nagios-zfs-0.1.0 features/step_definitions/dev_steps.rb
nagios-zfs-0.0.1 features/step_definitions/dev_steps.rb