Skip to content

Instantly share code, notes, and snippets.

@wrecked
Created March 2, 2009 00:04
Show Gist options
  • Save wrecked/72537 to your computer and use it in GitHub Desktop.
Save wrecked/72537 to your computer and use it in GitHub Desktop.
dash_steps.rb
# Step definitions for testing metrics from Dash - http://dash.fiveruns.com
#
# bradley - railsmachine.com
# add your key
APPKEY = "YOUR_KEY_HERE"
When /^I check the "(.*)" metric$/ do |metric|
visit "https://dash.fiveruns.com/apps/#{APPKEY}/metrics/#{metric}.txt"
end
Then /^the value should equal (.*)$/ do |val|
webrat.response.body.to_f.should == val.to_f
end
Then /^the value should not equal (.*)$/ do |val|
webrat.response.body.to_f.should_not == val.to_f
end
Then /^the value should be greater than (.*)$/ do |val|
webrat.response.body.to_f.should be > val.to_f
end
Then /^the value should be less than (.*)$/ do |val|
webrat.response.body.to_f.should be < val.to_f
end
Then /^the value should be equal to or greater than (.*)$/ do |val|
webrat.response.body.to_f.should be >= val.to_f
end
Then /^the value should be equal to or less than (.*)$/ do |val|
webrat.response.body.to_f.should be <= val.to_f
end
Then /^the value should be within (.*) of (.*)$/ do |tol, val|
webrat.response.body.to_f.should be_close(val.to_f, tol.to_f)
end
Then /^the value should not be within (.*) of (.*)$/ do |tol, val|
webrat.response.body.to_f.should_not be_close(val.to_f, tol.to_f)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment