features/steps/formatting_steps.rb in xcpretty-0.0.3 vs features/steps/formatting_steps.rb in xcpretty-0.0.4
- old
+ new
@@ -17,10 +17,14 @@
Given(/^I have a passing test in my suite$/) do
add_run_input SAMPLE_OCUNIT_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
add_run_input SAMPLE_OCUNIT_SUITE_BEGINNING
end
Given(/^I finish a test suite$/) do
@@ -30,19 +34,19 @@
When(/^I pipe to xcpretty with "(.*?)"$/) do |flags|
run_xcpretty(flags)
end
Then(/^I should see a successful compilation message$/) do
- run_output.should start_with("Compiling")
+ run_output.should start_with("▸ Compiling")
end
Then(/^I should see a successful precompilation message$/) do
- run_output.should start_with("Precompiling")
+ run_output.should start_with("▸ Precompiling")
end
-Then(/^I should see a green success icon$/) do
- run_output.should start_with("#{GREEN_START}✓#{COLOR_END}")
+Then(/^I should see a yellow completion icon$/) do
+ run_output.should start_with(yellow("▸"))
end
Then(/^I should see a failed test icon$/) do
run_output.should start_with("F")
end
@@ -50,22 +54,20 @@
Then(/^I should see a passing test icon in ASCII$/) do
run_output.should start_with(".")
end
Then(/^I should see a red failed test icon$/) do
- run_output.should include("#{RED_START}F#{COLOR_END}")
+ run_output.should include(red("F"))
end
Then(/^the final execution message should be (red|green)$/) do |color|
last_line = run_output.lines.to_a.last
- start_color = color == "red" ? RED_START : GREEN_START
- last_line.should start_with(start_color)
- last_line.strip.should end_with(COLOR_END)
+ last_line.should be_colored(color.to_sym)
end
Then(/^I should see a green passing test icon$/) do
- run_output.should include("#{GREEN_START}.#{COLOR_END}")
+ run_output.should include(green("."))
end
Then(/^I should see the name of a failed test$/) do
run_output.should =~ FAILING_TEST_NAME_MATCHER
end
@@ -80,20 +82,28 @@
Then(/^I should not see the path of a passing test$/) do
run_output.should_not =~ TEST_PATH_MATCHER
end
-Then(/^I should see that the test suite started$/) do
- run_output.should =~ TEST_SUITE_BEGINNING_MATCHER
+Then(/^I should see that test suite has started$/) do
+ run_output.should =~ TEST_RUN_START_MATCHER
end
+Then(/^I should see the name of suite only$/) do
+ run_output.should =~ TEST_SUITE_START_MATCHER
+end
+
Then(/^I should see that the test suite finished$/) do
run_output.strip.should =~ TEST_SUITE_COMPLETION_MATCHER
end
Then(/^I should see a red failed test mark$/) do
- run_output.should include("#{RED_START}✗#{COLOR_END}")
+ run_output.should include(red("✗"))
end
Then(/^I should see a green passing test mark$/) do
- run_output.should include("#{GREEN_START}✓#{COLOR_END}")
+ run_output.should include(green("✓"))
+end
+
+Then(/^I should not see the name of the test group$/) do
+ run_output.should_not include(SAMPLE_TEST_GROUP_NAME)
end