spec/xcpretty/parser_spec.rb in xcpretty-0.1.3 vs spec/xcpretty/parser_spec.rb in xcpretty-0.1.4
- old
+ new
@@ -66,10 +66,22 @@
it "parses compiling classes" do
@formatter.should receive(:format_compile).with("KWNull.m", "Classes/Core/KWNull.m")
@parser.parse(SAMPLE_ANOTHER_COMPILE)
end
+ it "parses compiling Objective-C++ classes" do
+ @formatter.should receive(:format_compile).with("KWNull.mm", "Classes/Core/KWNull.mm")
+ @parser.parse(SAMPLE_ANOTHER_COMPILE.sub('.m', '.mm'))
+ end
+
+ it "parses compiling C and C++ files" do
+ for file_extension in ['.c', '.cc', '.cpp', '.cxx'] do
+ @formatter.should receive(:format_compile).with("KWNull" + file_extension, "Classes/Core/KWNull" + file_extension)
+ @parser.parse(SAMPLE_ANOTHER_COMPILE.sub('.m', file_extension))
+ end
+ end
+
it "parses compiling XIBs" do
@formatter.should receive(:format_compile_xib).with("MainMenu.xib", "CocoaChip/en.lproj/MainMenu.xib")
@parser.parse(SAMPLE_COMPILE_XIB)
end
@@ -101,26 +113,40 @@
it "parses Libtool" do
@formatter.should receive(:format_libtool).with('libPods-ObjectiveSugarTests-Kiwi.a')
@parser.parse(SAMPLE_LIBTOOL)
end
- it "parses failing tests" do
+ it "parses specta failing tests" do
+ @formatter.should receive(:format_failing_test).with("SKWelcomeViewControllerSpecSpec",
+ "SKWelcomeViewController_When_a_user_opens_the_app_from_a_clean_installation_displays_the_welcome_screen",
+ "The step timed out after 2.00 seconds: Failed to find accessibility element with the label \"The asimplest way to make smarter business decisions\"",
+ "/Users/vickeryj/Code/ipad-register/KIFTests/Specs/SKWelcomeViewControllerSpec.m:11")
+ @parser.parse(SAMPLE_SPECTA_FAILURE)
+ end
+
+ it "parses old specta failing tests" do
@formatter.should receive(:format_failing_test).with("RACCommandSpec",
"enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES",
"expected: 1, got: 0",
- #"expect([command.enabled first]).to.equal(@YES);", # outside of PR scope
"/Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458")
- @parser.parse(SAMPLE_SPECTA_FAILURE)
+ @parser.parse(SAMPLE_OLD_SPECTA_FAILURE)
end
- it "parses passing tests" do
+ it "parses passing ocunit tests" do
@formatter.should receive(:format_passing_test).with('RACCommandSpec',
'enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES',
'0.001')
@parser.parse(SAMPLE_OCUNIT_TEST)
end
+ it "parses passing specta tests" do
+ @formatter.should receive(:format_passing_test).with('SKWelcomeActivationViewControllerSpecSpec',
+ 'SKWelcomeActivationViewController_When_a_user_enters_their_details_lets_them_enter_a_valid_manager_code',
+ '0.725')
+ @parser.parse(SAMPLE_SPECTA_TEST)
+ end
+
it "parses pending tests" do
@formatter.should receive(:format_pending_test).with('TAPIConversationSpec',
'TAPIConversation_createConversation_SendsAPOSTRequestToTheConversationsEndpoint')
@parser.parse(SAMPLE_PENDING_KIWI_TEST)
end
@@ -165,25 +191,40 @@
SAMPLE_UNDEFINED_SYMBOLS.each_line do |line|
@parser.parse(line)
end
end
- it "parses test run finished" do
+ it "parses ocunit test run finished" do
@formatter.should receive(:format_test_run_finished).with('ReactiveCocoaTests.octest(Tests)', '2013-12-10 07:03:03 +0000.')
@parser.parse(SAMPLE_OCUNIT_TEST_RUN_COMPLETION)
end
- it "parses test run started" do
+ it "parses specta test run finished" do
+ @formatter.should receive(:format_test_run_finished).with('KIFTests.xctest', '2014-02-28 15:44:32 +0000.')
+ @parser.parse(SAMPLE_SPECTA_TEST_RUN_COMPLETION)
+ end
+
+ it "parses ocunit test run started" do
@formatter.should receive(:format_test_run_started).with('ReactiveCocoaTests.octest(Tests)')
@parser.parse(SAMPLE_OCUNIT_TEST_RUN_BEGINNING)
end
- it "parses test suite started" do
+ it "parses specta test run started" do
+ @formatter.should receive(:format_test_run_started).with('KIFTests.xctest')
+ @parser.parse(SAMPLE_SPECTA_TEST_RUN_BEGINNING)
+ end
+
+ it "parses ocunit test suite started" do
@formatter.should receive(:format_test_suite_started).with('RACKVOWrapperSpec')
@parser.parse(SAMPLE_OCUNIT_SUITE_BEGINNING)
end
+ it "parses specta test suite started" do
+ @formatter.should receive(:format_test_suite_started).with('All tests')
+ @parser.parse(SAMPLE_SPECTA_SUITE_BEGINNING)
+ end
+
context "errors" do
it "parses clang errors" do
@formatter.should receive(:format_error).with(SAMPLE_CLANG_ERROR)
@parser.parse(SAMPLE_CLANG_ERROR)
@@ -309,13 +350,19 @@
it "returns empty string if the suite is not done" do
@parser.parse(SAMPLE_EXECUTED_TESTS).should == ""
end
- it "knows when the test suite is done for OCunit / Specta" do
+ it "knows when the test suite is done for OCunit" do
given_tests_are_done
@formatter.should receive(:format_test_summary)
@parser.parse(SAMPLE_EXECUTED_TESTS)
+ end
+
+ it "knows when the test suite is done for Specta" do
+ given_tests_are_done
+ @formatter.should receive(:format_test_summary)
+ @parser.parse(SAMPLE_SPECTA_EXECUTED_TESTS)
end
it "doesn't print executed message twice for Kiwi tests" do
@formatter.should_receive(:format_test_summary).once
given_tests_have_started(SAMPLE_KIWI_TEST_RUN_BEGINNING)