features/steps/formatting_steps.rb in xcpretty-0.1.3 vs features/steps/formatting_steps.rb in xcpretty-0.1.4
- old
+ new
@@ -18,11 +18,11 @@
Given(/^I have a file to shallow analyze$/) do
add_run_input SAMPLE_ANALYZE_SHALLOW
end
Given(/^I have a failing test in my suite$/) do
- add_run_input SAMPLE_SPECTA_FAILURE
+ add_run_input SAMPLE_OLD_SPECTA_FAILURE
end
Given(/^all of my tests will pass in my suite$/) do
3.times { add_run_input SAMPLE_OCUNIT_TEST }
end
@@ -90,10 +90,22 @@
Given(/^I have a file to touch$/) do
add_run_input SAMPLE_TOUCH
end
+Then(/^I should see text beginning with "(.*?)"$/) do |text|
+ run_output.lines.to_a.detect {|line| line.start_with? text }.should_not be_nil
+end
+
+Then(/^I should see text containing "(.*?)" and beginning with "(.*?)"$/) do |inner, start|
+ run_output.lines.to_a.detect {|line| line.start_with?(start) && line.include?(inner)}.should_not be_nil
+end
+
+Then(/^I should (green|red) text beginning with "(.*?)"$/) do |color, text|
+ run_output.should start_with(send(color.to_sym, text))
+end
+
Then(/^I should see a successful tiff validation message$/) do
run_output.should start_with("▸ Validating")
end
Then(/^I should see a successful touch message$/) do
@@ -246,7 +258,11 @@
Then(/^I should see the test time in yellow$/) do
run_output.should include("#{yellow("0.026")}")
end
Then(/^I should see the test time in red$/) do
- run_output.should include("#{red("0.101")}") end
+ run_output.should include("#{red("0.101")}")
+end
+Then(/^I should see text matching "(.*?)"$/) do |text|
+ run_output.lines.to_a.last.strip.should == text
+end