features/steps/formatting_steps.rb in xcpretty-0.1.12 vs features/steps/formatting_steps.rb in xcpretty-0.2.0

- old
+ new

@@ -5,10 +5,14 @@ Given(/^I have a xib to compile$/) do add_run_input SAMPLE_COMPILE_XIB end +Given(/^I have a storyboard to compile$/) do + add_run_input SAMPLE_COMPILE_STORYBOARD +end + Given(/^I have a precompiled header$/) do add_run_input SAMPLE_PRECOMPILE end Given(/^I have a file to analyze$/) do @@ -74,10 +78,14 @@ Given(/^there was a syntax error$/) do add_run_input SAMPLE_COMPILE_ERROR end +Given(/^there was a missing file$/) do + add_run_input SAMPLE_FILE_MISSING_ERROR +end + Given(/^there were warnings in the code$/) do add_run_input SAMPLE_FORMAT_WARNING end Given(/^the linker has failed with undefined symbols$/) do @@ -106,16 +114,28 @@ Given(/^I have an unrelated image in the output folder/) do copy_file_to_screenshot_dir(SAMPLE_UNRELATED_IMAGE_FILE) end +Given(/^I have completed a build$/) do + add_run_input SAMPLE_BUILD_SUCCEEDED +end + +Given(/^I have completed a clean$/) do + add_run_input SAMPLE_CLEAN_SUCCEEDED +end + +Then(/^I should see a "(\w+)" completion message$/) do |phase| + run_output.should start_with("▸ #{phase.capitalize} Succeeded") +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 + 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 + 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 @@ -249,13 +269,21 @@ 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("⌦ " + SAMPLE_PODS_ERROR.gsub('error: ', ''))) + run_output.should include(red("❌ error: ")[0..-5]) # trim \e[0m end +Then(/^I should see that sandbox is not in sync with Podfile.lock$/) do + run_output.should include("The sandbox is not in sync with the Podfile.lock") +end + +Then(/^I should see which file is missing$/) do + run_output.should include(SAMPLE_FILE_MISSING_ERROR.split('directory: ')[1].delete("'")) +end + Then(/^I should see a yellow warning message$/) do run_output.should include("#{yellow('⚠️ ')}/Users/supermarin/code/oss/ObjectiveSugar/Example/ObjectiveSugar/AppDelegate.m:19:31:") run_output.should include(yellow("format specifies type 'id' but the argument has type 'int' [-Wformat]")) end @@ -270,11 +298,11 @@ Then(/^I should see a cyan cursor$/) do run_output.should include(cyan(" ^")) end Then(/^I should see the undefined symbold message$/) do - run_output.should include(red("⌦ Undefined symbols for architecture x86_64")) + run_output.should include(red("❌ Undefined symbols for architecture x86_64")) end 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") @@ -297,5 +325,6 @@ end Then(/^I should see text matching "(.*?)"$/) do |text| run_output.lines.to_a.last.strip.should == text end +