features/steps/formatting_steps.rb in xcpretty-0.0.6 vs features/steps/formatting_steps.rb in xcpretty-0.0.7
- old
+ new
@@ -1,14 +1,26 @@
# encoding: utf-8
Given(/^I have a file to compile$/) do
add_run_input SAMPLE_COMPILE
end
+Given(/^I have a xib to compile$/) do
+ add_run_input SAMPLE_COMPILE_XIB
+end
+
Given(/^I have a precompiled header$/) do
add_run_input SAMPLE_PRECOMPILE
end
+Given(/^I have a file to analyze$/) do
+ add_run_input SAMPLE_ANALYZE
+end
+
+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
end
Given(/^all of my tests will pass in my suite$/) do
@@ -25,26 +37,82 @@
Given(/^I start a test suite$/) do
add_run_input SAMPLE_OCUNIT_SUITE_BEGINNING
end
-Given(/^I finish a test suite$/) do
+Given(/^the test suite has finished$/) do
add_run_input SAMPLE_OCUNIT_SUITE_COMPLETION
+ add_run_input SAMPLE_EXECUTED_TESTS
end
+Given(/^I have a file to code sign$/) do
+ add_run_input SAMPLE_CODESIGN
+end
+
+Given(/^I have a framework to code sign$/) do
+ add_run_input SAMPLE_CODESIGN_FRAMEWORK
+end
+
+Given(/^I have a file to preprocess$/) do
+ add_run_input SAMPLE_PREPROCESS
+end
+
+Given(/^I have a file to copy with PBXCp/) do
+ add_run_input SAMPLE_PBXCP
+end
+
+Given(/^podfile.lock wasn't in sync$/) do
+ add_run_input SAMPLE_PODS_ERROR
+end
+
+Given(/^there was a syntax error$/) do
+ SAMPLE_COMPILE_ERROR.split("\n").each do |line|
+ add_run_input(line)
+ end
+end
+
When(/^I pipe to xcpretty with "(.*?)"$/) do |flags|
run_xcpretty(flags)
end
+When(/^I pipe to xcpretty with a custom formatter$/) do
+ formatter_path = File.expand_path('../../../spec/fixtures/custom_formatter.rb', __FILE__)
+ run_xcpretty("-f #{formatter_path}")
+end
+
+When(/^I pipe to xcpretty$/) do
+ run_xcpretty("")
+end
+
+Then(/^I should see a custom compilation message$/) do
+ run_output.should start_with("😎 Compilation party time")
+end
+
Then(/^I should see a successful compilation message$/) do
run_output.should start_with("â–¸ Compiling")
end
Then(/^I should see a successful precompilation message$/) do
run_output.should start_with("â–¸ Precompiling")
end
+Then(/^I should see a successful analyze message$/) do
+ run_output.should start_with("â–¸ Analyzing")
+end
+
+Then(/^I should see a successful code signing message$/) do
+ run_output.should start_with("â–¸ Signing")
+end
+
+Then(/^I should see a successful preprocessing message$/) do
+ run_output.should start_with("â–¸ Preprocessing")
+end
+
+Then(/^I should see a successful copying message$/) do
+ run_output.should start_with("â–¸ Copying")
+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
@@ -103,13 +171,28 @@
Then(/^I should see a green passing test mark$/) do
run_output.should include(green("✓"))
end
Then(/^I should see a non-utf prefixed output$/) do
- run_output.should start_with(".")
+ run_output.should start_with(green("."))
end
+Then(/^I should not see the name of the test group$/) do
+ run_output.should_not include("RACTupleSpec")
+end
+Then(/^I should see a red error message$/) do
+ run_output.should include(red("⌦ ") + " " + red(SAMPLE_PODS_ERROR.gsub('error: ', '')))
+end
-Then(/^I should not see the name of the test group$/) do
- run_output.should_not include(SAMPLE_TEST_GROUP_NAME)
+Then(/^I should see a red compilation error$/) do
+ run_output.should include(red("expected identifier"))
end
+
+Then(/^I should see a failed line$/) do
+ run_output.should include("[[thread.lastMessage should] equal:thread.];")
+end
+
+Then(/^I should see a cyan cursor$/) do
+ run_output.should include(cyan(" ^"))
+end
+