features/steps/formatting_steps.rb in xcpretty-0.0.9 vs features/steps/formatting_steps.rb in xcpretty-0.1.0

- old
+ new

@@ -29,10 +29,18 @@ Given(/^I have a passing test in my suite$/) do add_run_input SAMPLE_OCUNIT_TEST end +Given(/^I have a slow\-ish test in my suite$/) do + add_run_input SAMPLE_SLOWISH_TEST +end + +Given(/^I have a slow test in my suite$/) do + add_run_input SAMPLE_SLOW_TEST +end + Given(/^the tests have started running$/) do add_run_input SAMPLE_OCUNIT_TEST_RUN_BEGINNING end Given(/^I start a test suite$/) do @@ -70,10 +78,30 @@ Given(/^the linker has failed with undefined symbols$/) do add_run_input SAMPLE_UNDEFINED_SYMBOLS end +Given(/^I have a pending test in my suite$/) do + add_run_input SAMPLE_PENDING_KIWI_TEST +end + +Given(/^I have a tiff file to validate$/) do + add_run_input SAMPLE_TIFFUTIL +end + +Given(/^I have a file to touch$/) do + add_run_input SAMPLE_TOUCH +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 + run_output.should start_with("▸ Touching") +end + When(/^I pipe to xcpretty with "(.*?)"$/) do |flags| run_xcpretty(flags) end When(/^I pipe to xcpretty with a custom formatter$/) do @@ -127,10 +155,18 @@ Then(/^I should see a red failed test icon$/) do run_output.should include(red("F")) end +Then(/^I should see a pending test icon in ASCII$/) do + run_output.should start_with("P") +end + +Then(/^I should see a yellow pending test icon$/) do + run_output.should start_with(yellow("P")) +end + Then(/^the final execution message should be (red|green)$/) do |color| last_line = run_output.lines.to_a.last last_line.should be_colored(color.to_sym) end @@ -204,6 +240,17 @@ Then(/^I should see the symbol and reference that caused failure$/) do run_output.should include("_OBJC_CLASS_$_CABasicAnimation") run_output.should include("objc-class-ref in ATZRadialProgressControl.o") end + +Then(/^I should see the name of a pending test$/) do + run_output.should =~ PENDING_TEST_NAME_MATCHER +end + +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