Created
March 2, 2009 00:04
-
-
Save wrecked/72537 to your computer and use it in GitHub Desktop.
dash_steps.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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