Skip to content

Instantly share code, notes, and snippets.

@ideasasylum
Created June 24, 2010 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ideasasylum/452055 to your computer and use it in GitHub Desktop.
Save ideasasylum/452055 to your computer and use it in GitHub Desktop.
This is how I use should_change macros
context "Parsing example file" do
setup {
@xml = File.open(File.expand_path(File.dirname(__FILE__) + '/../EICK.xml'), 'r'){|f| f.read }
parse_hamweather_data(@xml)
}
should_change("the number of forecasts", :by => 8) {Forecast.count}
should_change("the number of current forecasts", :by => 1) {Forecast.count :conditions => 'current = true'}
should_change("the number of 3hour forecasts", :by => 7) {Forecast.count :conditions => 'priority = 2'}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment