C0 code coverage information
Generated on Sun May 10 11:15:58 +0100 2009 with rcov 0.8.2.1
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 Given /no pre-existing articles/ do
2 Article.destroy_all
3 end
4
5 Given /^(\d+) newsworthy articles$/i do |count|
6 Article.transaction do
7 1.upto(count.to_i) do |number|
8 Article.create!(:title => "Newsworthy article title #{number}",:abstract => "Newsworthy article abstract #{number}",:content => "Newsworthy article content #{number}", :is_news => true, :visible => true)
9 end
10 end
11 end
12
13 Then /I should see (\d+) (.*?) article (.*?)s$/ do |count,keyword,type|
14 response.body.scan(/#{keyword} article #{type} \d+/m).size.should == count.to_i
15 end
16
17
18 Given /a visible article with title "(.*?)"/i do |title|
19 @article = Article.create!(:title => title, :abstract => "#{title}:abstract", :content => "#{title}:content", :visible => true)
20 end
21
22 Given /a hidden article with title "(.*?)"/i do |title|
23 @article = Article.create!(:title => title, :abstract => "#{title}:abstract", :content => "#{title}:content", :visible => false)
24 end
25
26
27 Then /I should see a heading "(.*?)"$/ do |heading|
28 begin
29 response.body.should =~ %r{<h2.*?>#{heading}</h2>}i
30 rescue Spec::Expectations::ExpectationNotMetError
31 save_and_open_page
32 raise
33 end
34 end
35
36 Given /^an "([^"]*?)" article with tags "([^"]*?)"$/ do |title,tags|
37 @article = Article.create!(:title => title, :abstract => "#{title}:abstract", :content => "#{title}:content", :tag_list => tags, :visible => true)
38 end
39
40 Given /^an "([^"]*?)" article with tags "([^"]*?)" and category "([^"]*?)"$/ do |title,tags,category|
41 @article = Article.create!(:title => title, :abstract => "#{title}:abstract", :content => "#{title}:content", :tag_list => tags, :visible => true, :article_category => ArticleCategory.find_or_create_by_title(category))
42 end
43
44 When /^I visit the article page$/ do
45 visit article_url(@article)
46 end
47
Generated using the rcov code coverage analysis tool for Ruby
version 0.8.2.1.