xcpretty 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 312a49c2395ef4423b388d5308643954924f487f
4
- data.tar.gz: 6253bca6389c6956b2fbbc1ae6919294740462b6
3
+ metadata.gz: 31863314278364422289e7c4779a6683d041dd24
4
+ data.tar.gz: f6aa3f0ec6ec0b35d5b68eda5e0b3fd4b7471a3a
5
5
  SHA512:
6
- metadata.gz: e7edfc065c451e809dbda04ce749165288d2c3f1896179dd8cf98a7d9d591ec6a042e0524ba1d9ba69a7b0d40a4baded7c9ec2db3633294472d1dc9264313cdf
7
- data.tar.gz: d8fac2769db30fedaa440aa23921dc2d0004ae6aab59a83fb50b42785b5230308e483b276a110be07880ddcbcbac31232a6bc6a8df9b933cbba3a96e69d7fe6e
6
+ metadata.gz: 758a1e2ece5183a65bd5e5a2760f64fcb9c740db4ee15d00ada137d9a5660b68e095512ff5e1eaf2f3999fbc5ed2891c4c7a97cea2b096dacd82e0666846fbb2
7
+ data.tar.gz: 948b4c6b735cc76abed63d14657af2e28e9137445d1c9071a8884048e8ddbb59a7bf7ddbea871349ea214e8b87a51b2552113b794f2cc70175e4a91f8f12f91f
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## TBD
4
+
5
+ - remove paint dependency
6
+ - better test failure formatting
7
+
8
+ ## 0.0.3
9
+
10
+ - add Ruby 1.8 support
11
+
12
+ ## 0.0.2
13
+
14
+ - add Ruby 1.9 support
15
+
16
+ ## 0.0.1
17
+
18
+ - initial version
data/README.md CHANGED
@@ -39,7 +39,22 @@ At this point, `xcodebuild` has got improved a lot, and it's ready to be used di
39
39
 
40
40
  There are many usages of this tool. Let me give you some ideas:
41
41
  - Xcode's test tools are close to useless. Failures in a sidebar, non-dettachable console,... You can use `xcpretty` to build your next Xcode test runner plugin
42
- - Run tests each time you hit save. The output is minimal, so go and wire it up with [Kicker](https://github.com/alloy/kicker) or [Guard](https://github.com/guard/guard) and be a real hipster!
42
+ - Run tests each time you hit save. Here's an example of doing so:
43
+
44
+ ``` ruby
45
+ require 'listen'
46
+ ignored = [/.git/, /xcuserdata/, /\.txt$/, /test-reports/]
47
+ build_task = "xcodebuild -workspace Myapp.xcworkspace -scheme MyApp -sdk iphonesimulator -destination 'name=iPhone Retina (4-inch 64-bit)'"
48
+
49
+ listener = Listen.to(Dir.pwd, ignore: ignored) do |modified, added, removed|
50
+ system 'killall "iPhone Simulator"'
51
+ system "#{build_task} test | xcpretty -tc"
52
+ end
53
+
54
+ listener.start
55
+ sleep
56
+ ```
57
+ Just add this to your Rakefile, or in a ruby script. Make sure you `gem install listen`.
43
58
  - Mine Bitcoins. You can't with this tool, but you'll be so productive that you can earn all the money and buy them!!!1!
44
59
 
45
60
  ## Roadmap
data/bin/xcpretty CHANGED
@@ -22,10 +22,14 @@ OptionParser.new do |opts|
22
22
  opts.on('-c', '--color', 'Use colorized output') do
23
23
  @colorize = true
24
24
  end
25
+ opts.on('--no-utf', 'Disable unicode characters in output') do
26
+ @unicode = false
27
+ end
25
28
  opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit }
26
29
  opts.on_tail("-v", "--version", "Show version") { puts XCPretty::VERSION; exit }
27
30
  opts.parse!
28
31
  printer.colorize = @colorize
32
+ printer.use_unicode = @unicode || true
29
33
  end
30
34
 
31
35
  ARGF.each_line do |line|
@@ -1,56 +1,62 @@
1
1
  Feature: Showing build output in simple format
2
2
 
3
- Scenario: Showing file compilation
4
- Given I have a file to compile
5
- When I pipe to xcpretty with "--simple"
6
- Then I should see a successful compilation message
7
-
8
- Scenario: Showing precompilation
9
- Given I have a precompiled header
10
- When I pipe to xcpretty with "--simple"
11
- Then I should see a successful precompilation message
12
-
13
- Scenario: Showing file compilation with color
14
- Given I have a file to compile
15
- When I pipe to xcpretty with "--simple --color"
16
- Then I should see a green success icon
17
-
18
- Scenario: Showing precompilation
19
- Given I have a precompiled header
20
- When I pipe to xcpretty with "--simple --color"
21
- Then I should see a green success icon
22
-
23
- Scenario: Showing the start of a test suite
24
- Given I start a test suite
25
- When I pipe to xcpretty with "--simple"
26
- Then I should see that the test suite started
27
-
28
- Scenario: Showing the end of a test suite
29
- Given I finish a test suite
30
- When I pipe to xcpretty with "--simple"
31
- Then I should see that the test suite finished
32
-
33
- Scenario: Showing failed test output
34
- Given I have a failing test in my suite
35
- When I pipe to xcpretty with "--simple"
36
- Then I should see the name of a failed test
37
- And I should see the path of a failed test
38
-
39
- Scenario: Showing successful test output
40
- Given I have a passing test in my suite
41
- When I pipe to xcpretty with "--simple"
42
- Then I should see the name of a passing test
43
- And I should not see the path of a passing test
44
-
45
- Scenario: Showing failed test output with color
46
- Given I have a failing test in my suite
47
- And I finish a test suite
48
- When I pipe to xcpretty with "--simple --color"
49
- Then I should see a red failed test mark
50
- And the final execution message should be red
51
-
52
- Scenario: Showing successful test output with color
53
- Given I have a passing test in my suite
54
- And I finish a test suite
55
- When I pipe to xcpretty with "--simple --color"
56
- Then I should see a green passing test mark
3
+ Scenario: Showing file compilation
4
+ Given I have a file to compile
5
+ When I pipe to xcpretty with "--simple"
6
+ Then I should see a successful compilation message
7
+
8
+ Scenario: Showing precompilation
9
+ Given I have a precompiled header
10
+ When I pipe to xcpretty with "--simple"
11
+ Then I should see a successful precompilation message
12
+
13
+ Scenario: Showing file compilation with color
14
+ Given I have a file to compile
15
+ When I pipe to xcpretty with "--simple --color"
16
+ Then I should see a yellow completion icon
17
+
18
+ Scenario: Showing precompilation
19
+ Given I have a precompiled header
20
+ When I pipe to xcpretty with "--simple --color"
21
+ Then I should see a yellow completion icon
22
+
23
+ Scenario: Showing the start of a test run
24
+ Given the tests have started running
25
+ When I pipe to xcpretty with "--simple"
26
+ Then I should see that test suite has started
27
+
28
+ Scenario: Showing the start of a test suite
29
+ Given I start a test suite
30
+ When I pipe to xcpretty with "--simple"
31
+ Then I should see the name of suite only
32
+
33
+ Scenario: Showing the end of a test suite
34
+ Given I finish a test suite
35
+ When I pipe to xcpretty with "--simple"
36
+ Then I should see that the test suite finished
37
+
38
+ Scenario: Showing failed test output
39
+ Given I have a failing test in my suite
40
+ When I pipe to xcpretty with "--simple"
41
+ Then I should see the name of a failed test
42
+ And I should see the path of a failed test
43
+
44
+ Scenario: Showing successful test output
45
+ Given I have a passing test in my suite
46
+ When I pipe to xcpretty with "--simple"
47
+ Then I should see the name of a passing test
48
+ And I should not see the name of the test group
49
+ And I should not see the path of a passing test
50
+
51
+ Scenario: Showing failed test output with color
52
+ Given I have a failing test in my suite
53
+ And I finish a test suite
54
+ When I pipe to xcpretty with "--simple --color"
55
+ Then I should see a red failed test mark
56
+ And the final execution message should be red
57
+
58
+ Scenario: Showing successful test output with color
59
+ Given I have a passing test in my suite
60
+ And I finish a test suite
61
+ When I pipe to xcpretty with "--simple --color"
62
+ Then I should see a green passing test mark
@@ -19,6 +19,10 @@ Given(/^I have a passing test in my suite$/) do
19
19
  add_run_input SAMPLE_OCUNIT_TEST
20
20
  end
21
21
 
22
+ Given(/^the tests have started running$/) do
23
+ add_run_input SAMPLE_OCUNIT_TEST_RUN_BEGINNING
24
+ end
25
+
22
26
  Given(/^I start a test suite$/) do
23
27
  add_run_input SAMPLE_OCUNIT_SUITE_BEGINNING
24
28
  end
@@ -32,15 +36,15 @@ When(/^I pipe to xcpretty with "(.*?)"$/) do |flags|
32
36
  end
33
37
 
34
38
  Then(/^I should see a successful compilation message$/) do
35
- run_output.should start_with("Compiling")
39
+ run_output.should start_with("Compiling")
36
40
  end
37
41
 
38
42
  Then(/^I should see a successful precompilation message$/) do
39
- run_output.should start_with("Precompiling")
43
+ run_output.should start_with("Precompiling")
40
44
  end
41
45
 
42
- Then(/^I should see a green success icon$/) do
43
- run_output.should start_with("#{GREEN_START}✓#{COLOR_END}")
46
+ Then(/^I should see a yellow completion icon$/) do
47
+ run_output.should start_with(yellow(""))
44
48
  end
45
49
 
46
50
  Then(/^I should see a failed test icon$/) do
@@ -52,18 +56,16 @@ Then(/^I should see a passing test icon in ASCII$/) do
52
56
  end
53
57
 
54
58
  Then(/^I should see a red failed test icon$/) do
55
- run_output.should include("#{RED_START}F#{COLOR_END}")
59
+ run_output.should include(red("F"))
56
60
  end
57
61
 
58
62
  Then(/^the final execution message should be (red|green)$/) do |color|
59
63
  last_line = run_output.lines.to_a.last
60
- start_color = color == "red" ? RED_START : GREEN_START
61
- last_line.should start_with(start_color)
62
- last_line.strip.should end_with(COLOR_END)
64
+ last_line.should be_colored(color.to_sym)
63
65
  end
64
66
 
65
67
  Then(/^I should see a green passing test icon$/) do
66
- run_output.should include("#{GREEN_START}.#{COLOR_END}")
68
+ run_output.should include(green("."))
67
69
  end
68
70
 
69
71
  Then(/^I should see the name of a failed test$/) do
@@ -82,8 +84,12 @@ Then(/^I should not see the path of a passing test$/) do
82
84
  run_output.should_not =~ TEST_PATH_MATCHER
83
85
  end
84
86
 
85
- Then(/^I should see that the test suite started$/) do
86
- run_output.should =~ TEST_SUITE_BEGINNING_MATCHER
87
+ Then(/^I should see that test suite has started$/) do
88
+ run_output.should =~ TEST_RUN_START_MATCHER
89
+ end
90
+
91
+ Then(/^I should see the name of suite only$/) do
92
+ run_output.should =~ TEST_SUITE_START_MATCHER
87
93
  end
88
94
 
89
95
  Then(/^I should see that the test suite finished$/) do
@@ -91,9 +97,13 @@ Then(/^I should see that the test suite finished$/) do
91
97
  end
92
98
 
93
99
  Then(/^I should see a red failed test mark$/) do
94
- run_output.should include("#{RED_START}✗#{COLOR_END}")
100
+ run_output.should include(red(""))
95
101
  end
96
102
 
97
103
  Then(/^I should see a green passing test mark$/) do
98
- run_output.should include("#{GREEN_START}✓#{COLOR_END}")
104
+ run_output.should include(green(""))
105
+ end
106
+
107
+ Then(/^I should not see the name of the test group$/) do
108
+ run_output.should_not include(SAMPLE_TEST_GROUP_NAME)
99
109
  end
@@ -1,23 +1,23 @@
1
1
  $:.unshift File.expand_path('../../..', __FILE__)
2
2
 
3
3
  require "tempfile"
4
- require "spec/fixtures/constants.rb"
4
+ require "spec/fixtures/constants"
5
+ require "spec/support/matchers/colors"
6
+ require "lib/xcpretty/ansi"
5
7
 
8
+ include XCPretty::ANSI
9
+
10
+ TEST_RUN_START_MATCHER = /Test Suite .+ started/
6
11
  TEST_SUITE_COMPLETION_MATCHER = /Executed \d+ tests, with \d+ failures \(\d+ unexpected\) in \d+\.\d+ \(\d+\.\d+\) seconds/
7
- TEST_SUITE_BEGINNING_MATCHER = /Test Suite '.+' started/
12
+ TEST_SUITE_START_MATCHER = /[\w]*(Spec|Tests)$/
8
13
  TEST_PATH_MATCHER = %r{[\w/\-\s]+:\d+}
9
- PASSING_TEST_NAME_MATCHER = %r{\w+\s\w+\s\(\d+\.\d+\sseconds\)}
10
- FAILING_TEST_NAME_MATCHER = %r{\w+\s\w+, expected:}
11
-
12
- INPUT_FILE = "xcpretty_input"
13
- RED_START = "\e[31m"
14
- COLOR_END = "\e[0m"
15
- GREEN_START = "\e[32;1m"
14
+ PASSING_TEST_NAME_MATCHER = %r{\w+\s\(\d+\.\d+\sseconds\)}
15
+ FAILING_TEST_NAME_MATCHER = %r{\w+, expected:}
16
16
 
17
17
  def run_xcpretty flags
18
18
  add_run_input SAMPLE_OCUNIT_SUITE_COMPLETION
19
19
  add_run_input SAMPLE_EXECUTED_TESTS
20
- input_file = Tempfile.new(INPUT_FILE)
20
+ input_file = Tempfile.new("xcpretty_input")
21
21
  File.open(input_file.path, 'w') do |file|
22
22
  file.print run_input
23
23
  end
@@ -37,7 +37,11 @@ def run_output
37
37
  @output ||= ""
38
38
  end
39
39
 
40
+ Before do
41
+ self.colorize = true
42
+ end
43
+
40
44
  After do
41
45
  @input = ""
42
46
  @output = ""
43
- end
47
+ end
@@ -1,28 +1,28 @@
1
1
  Feature: Showing RSpec-style test output
2
2
 
3
- Scenario: Showing failed tests
4
- Given I have a failing test in my suite
5
- When I pipe to xcpretty with "--test"
6
- Then I should see a failed test icon
3
+ Scenario: Showing failed tests
4
+ Given I have a failing test in my suite
5
+ When I pipe to xcpretty with "--test"
6
+ Then I should see a failed test icon
7
7
 
8
- Scenario: Showing passing tests
9
- Given I have a passing test in my suite
10
- When I pipe to xcpretty with "--test"
11
- Then I should see a passing test icon in ASCII
8
+ Scenario: Showing passing tests
9
+ Given I have a passing test in my suite
10
+ When I pipe to xcpretty with "--test"
11
+ Then I should see a passing test icon in ASCII
12
12
 
13
- Scenario: Showing some tests failed with color
14
- Given I have a failing test in my suite
15
- When I pipe to xcpretty with "--test --color"
16
- Then I should see a red failed test icon
17
- And I should see the path of a failed test
18
- And the final execution message should be red
13
+ Scenario: Showing some tests failed with color
14
+ Given I have a failing test in my suite
15
+ When I pipe to xcpretty with "--test --color"
16
+ Then I should see a red failed test icon
17
+ And I should see the path of a failed test
18
+ And the final execution message should be red
19
19
 
20
- Scenario: Showing passing tests with colorization
21
- Given I have a passing test in my suite
22
- When I pipe to xcpretty with "--test --color"
23
- Then I should see a green passing test icon
20
+ Scenario: Showing passing tests with colorization
21
+ Given I have a passing test in my suite
22
+ When I pipe to xcpretty with "--test --color"
23
+ Then I should see a green passing test icon
24
24
 
25
- Scenario: Showing that all tests passed with color
26
- Given all of my tests will pass in my suite
27
- When I pipe to xcpretty with "--test --color"
28
- Then the final execution message should be green
25
+ Scenario: Showing that all tests passed with color
26
+ Given all of my tests will pass in my suite
27
+ When I pipe to xcpretty with "--test --color"
28
+ Then the final execution message should be green
@@ -0,0 +1,70 @@
1
+ module XCPretty
2
+ module ANSI
3
+ attr_accessor :colorize
4
+
5
+ FORMATTED_MATCHER = %r{\e\[(\d+)[;]?(\d+)?m(.*)\e\[0m}
6
+
7
+ EFFECT = {
8
+ :reset => '0',
9
+ :bold => '1',
10
+ :underline => '4'
11
+ }
12
+
13
+ COLORS = {
14
+ :black => '30',
15
+ :red => '31',
16
+ :green => '32',
17
+ :yellow => '33',
18
+ :blue => '34',
19
+ :cyan => '36',
20
+ :white => '37',
21
+ :plain => '39'
22
+ }
23
+
24
+ def colorize?
25
+ !!@colorize
26
+ end
27
+
28
+ def white(text)
29
+ ansi_parse(text, :plain, :bold)
30
+ end
31
+
32
+ def red(text)
33
+ ansi_parse(text, :red)
34
+ end
35
+
36
+ def green(text)
37
+ ansi_parse(text, :green, :bold)
38
+ end
39
+
40
+ def cyan(text)
41
+ ansi_parse(text, :cyan)
42
+ end
43
+
44
+ def yellow(text)
45
+ ansi_parse(text, :yellow)
46
+ end
47
+
48
+ def applied_effects(text)
49
+ effects = []
50
+ if text =~ FORMATTED_MATCHER
51
+ colors = COLORS.invert[$1]
52
+ effect = EFFECT.invert[$2]
53
+ effects << colors if colors
54
+ effects << effect if effect
55
+ end
56
+ effects
57
+ end
58
+
59
+ def strip(text)
60
+ text =~ FORMATTED_MATCHER ? $3 : text
61
+ end
62
+
63
+ def ansi_parse(text, color, effect=nil)
64
+ return text unless colorize?
65
+ colors_code = COLORS[color] || ''
66
+ effect_code = EFFECT[effect] ? ';' + EFFECT[effect] : ''
67
+ "\e[#{colors_code}#{effect_code}m#{text}\e[#{EFFECT[:reset]}m"
68
+ end
69
+ end
70
+ end
@@ -1,36 +1,48 @@
1
- require "paint"
1
+ require "xcpretty/ansi"
2
2
 
3
3
  module XCPretty
4
4
 
5
5
  module Printer
6
6
 
7
- attr_accessor :colorize
8
-
9
- # @regex Captured groups
10
- # $1 = file
11
- # $2 = test_case
12
- # $3 = failure_message
13
- FAILING_TEST_MATCHER = /(.+:\d+):\serror:\s[\+\-]\[(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
14
-
15
- # @regex Captured groups
16
- # $1 = test_case
17
- # $2 = time
18
- PASSING_TEST_MATCHER = /Test Case\s'-\[(.*)\]'\spassed\s\((\d*\.\d{3})\sseconds\)/
7
+ module Matchers
8
+ # @regex Captured groups
9
+ # $1 = suite
10
+ # $2 = time
11
+ TESTS_RUN_START_MATCHER = /Test Suite '(?:.*\/)?(.*[ox]ctest.*)' started at(.*)/
12
+
13
+ # @regex Captured groups
14
+ # $1 = suite
15
+ # $2 = time
16
+ TESTS_RUN_COMPLETION_MATCHER = /Test Suite '(?:.*\/)?(.*[ox]ctest.*)' finished at(.*)/
17
+
18
+ # @regex Captured groups
19
+ # $1 = test_case
20
+ # $2 = time
21
+ PASSING_TEST_MATCHER = /Test Case\s'-\[.*\s(.*)\]'\spassed\s\((\d*\.\d{3})\sseconds\)/
22
+
23
+ # @regex Captured groups
24
+ # $1 = file
25
+ # $2 = test_suite
26
+ # $3 = test_case
27
+ # $4 = reason
28
+ FAILING_TEST_MATCHER = /(.+:\d+):\serror:\s[\+\-]\[(.*)\s(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
29
+
30
+ # @regex Captured groups
31
+ # $1 test suite name
32
+ TEST_SUITE_START_MATCHER = /Test Suite '(.*)' started at/
33
+ EXECUTED_MATCHER = /^Executed/
34
+ end
19
35
 
20
- TESTS_DONE_MATCHER = /Test Suite ('.*\.(o|x)ctest(.*)') finished at/
21
- # @regex Captured groups
22
- # $1 test suite name
23
- TESTS_START_MATCHER = /Test Suite ('.*(\.(o|x)ctest(.*))?') started at/
24
- EXECUTED_MATCHER = /^Executed/
36
+ include ANSI
37
+ include Matchers
25
38
 
26
- Paint::SHORTCUTS[:printer] = {
27
- :white => Paint.color(:bold),
28
- :red => Paint.color(:red),
29
- :green => Paint.color(:green, :bright),
30
- :link => Paint.color(:cyan),
31
- }
39
+ def use_unicode=(bool)
40
+ @use_unicode = !!bool
41
+ end
32
42
 
33
- include Paint::Printer
43
+ def use_unicode?
44
+ !!@use_unicode
45
+ end
34
46
 
35
47
  def pretty_print(text)
36
48
  update_test_state(text)
@@ -42,10 +54,14 @@ module XCPretty
42
54
 
43
55
  def update_test_state(text)
44
56
  case text
45
- when FAILING_TEST_MATCHER
46
- store_failure($1, $2, $3)
47
- when TESTS_DONE_MATCHER
57
+ when TESTS_RUN_START_MATCHER
58
+ @tests_done = false
59
+ @printed_summary = false
60
+ @failures = {}
61
+ when TESTS_RUN_COMPLETION_MATCHER
48
62
  @tests_done = true
63
+ when FAILING_TEST_MATCHER
64
+ store_failure($1, $2, $3, $4)
49
65
  end
50
66
  end
51
67
 
@@ -75,34 +91,34 @@ module XCPretty
75
91
  end
76
92
 
77
93
  def test_summary(executed_message)
78
- formatted_failures = failures.map do |f|
79
- reason = colorize? ? red(f[:failure_message]) : f[:failure_message]
80
- path = colorize? ? link(f[:file]) : f[:file]
81
- "#{f[:test_case]}, #{reason}\n#{path}"
82
- end.join("\n\n")
94
+ formatted_suites = failures_per_suite.map do |suite, failures|
95
+ formatted_failures = failures.map do |f|
96
+ " #{f[:test_case]}, #{f[:reason]}\n #{f[:file]}"
97
+ end.join("\n\n")
98
+
99
+ "#{suite}\n#{formatted_failures}"
100
+ end
101
+
83
102
  final_message = if colorize?
84
- failures.any? ? red(executed_message) : green(executed_message)
103
+ formatted_suites.any? ? red(executed_message) : green(executed_message)
85
104
  else
86
105
  executed_message
87
106
  end
88
- text = [formatted_failures, final_message].join("\n\n\n").strip
107
+ text = [formatted_suites, final_message].join("\n\n\n").strip
89
108
  "\n\n#{text}"
90
109
  end
91
110
 
92
- def failures
93
- @failures ||= []
111
+ def failures_per_suite
112
+ @failures ||= {}
94
113
  end
95
114
 
96
- def store_failure(file, test_case, failure_message)
97
- failures << {
98
- :file => file,
115
+ def store_failure(file, test_suite, test_case, reason)
116
+ failures_per_suite[test_suite] ||= []
117
+ failures_per_suite[test_suite] << {
118
+ :file => cyan(file),
119
+ :reason => red(reason),
99
120
  :test_case => test_case,
100
- :failure_message => failure_message
101
121
  }
102
122
  end
103
-
104
- def colorize?
105
- !!@colorize
106
- end
107
123
  end
108
124
  end
@@ -11,9 +11,9 @@ module XCPretty
11
11
  def pretty_format(text)
12
12
  case text
13
13
  when PASSING_TEST_MATCHER
14
- colorize? ? green(PASS) : PASS
14
+ green(PASS)
15
15
  when FAILING_TEST_MATCHER
16
- colorize? ? red(FAIL) : FAIL
16
+ red(FAIL)
17
17
  else
18
18
  ""
19
19
  end
@@ -10,6 +10,10 @@ module XCPretty
10
10
 
11
11
  PASS = "✓"
12
12
  FAIL = "✗"
13
+ ASCII_PASS = "."
14
+ ASCII_FAIL = "x"
15
+ COMPLETION = "▸"
16
+ ASCII_COMPLETION = ">"
13
17
 
14
18
  def pretty_format(text)
15
19
  case text
@@ -42,8 +46,10 @@ module XCPretty
42
46
  when PASSING_TEST_MATCHER
43
47
  print_passing_test($1, $2)
44
48
  when FAILING_TEST_MATCHER
45
- print_failing_test($2, $3)
46
- when TESTS_START_MATCHER
49
+ print_failing_test($3, $4)
50
+ when TESTS_RUN_START_MATCHER
51
+ print_test_run_start($1)
52
+ when TEST_SUITE_START_MATCHER
47
53
  print_suite_start($1)
48
54
  else
49
55
  ""
@@ -55,11 +61,11 @@ module XCPretty
55
61
  end
56
62
 
57
63
  def print_failing_test(test_case, reason)
58
- format("", "#{test_case}, #{reason}", false)
64
+ format_test("#{test_case}, #{reason}", false)
59
65
  end
60
66
 
61
67
  def print_passing_test(test_case, time)
62
- format("", "#{test_case} (#{time} seconds)")
68
+ format_test("#{test_case} (#{time} seconds)")
63
69
  end
64
70
 
65
71
  def print_linking(text)
@@ -108,8 +114,12 @@ module XCPretty
108
114
  format("Generating DSYM file")
109
115
  end
110
116
 
117
+ def print_test_run_start(name)
118
+ heading("Test Suite", name, "started")
119
+ end
120
+
111
121
  def print_suite_start(name)
112
- heading("Test Suite", name, "started")
122
+ heading("", name, "")
113
123
  end
114
124
 
115
125
  def heading(prefix, text, description)
@@ -119,14 +129,21 @@ module XCPretty
119
129
 
120
130
  def format(command, argument_text="", success=true)
121
131
  command_text = colorize? ? white(command) : command
122
- [status_symbol(success), command_text, argument_text].join(" ").strip
132
+ [status_symbol(success ? :completion : :fail), command_text, argument_text].join(" ").strip
133
+ end
134
+
135
+ def format_test(test_case, success=true)
136
+ [status_symbol(success ? :pass : :fail), test_case].join(" ").strip
123
137
  end
124
138
 
125
- def status_symbol(success)
126
- if success && colorize?
127
- green(PASS)
128
- elsif colorize?
129
- red(FAIL)
139
+ def status_symbol(status)
140
+ case status
141
+ when :pass
142
+ green(use_unicode? ? PASS : ASCII_PASS)
143
+ when :fail
144
+ red(use_unicode? ? FAIL : ASCII_FAIL)
145
+ when :completion
146
+ yellow(use_unicode? ? COMPLETION : ASCII_COMPLETION)
130
147
  else
131
148
  ""
132
149
  end
@@ -1,3 +1,3 @@
1
1
  module XCPretty
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,12 +1,20 @@
1
1
  # encoding: utf-8
2
2
  KIWI = 'kiwi'
3
3
  OCUNIT = 'ocunit'
4
- SAMPLE_OCUNIT_SUITE_BEGINNING = "Test Suite '/path/to/a/suite.xctest(Tests)' started at 2013-12-09 05:05:58 +0000."
4
+ SAMPLE_TEST_GROUP_NAME = "RACTupleSpec"
5
+ SAMPLE_OCUNIT_TEST_RUN_BEGINNING = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' started at 2013-12-10 07:04:33 +0000"
6
+ SAMPLE_KIWI_TEST_RUN_BEGINNING = "Test Suite 'ObjectiveRecordTests.xctest' started at 2013-12-10 06:15:39 +0000"
7
+ SAMPLE_OCUNIT_TEST_RUN_COMPLETION = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' finished at 2013-12-10 07:03:03 +0000."
8
+ SAMPLE_KIWI_TEST_RUN_COMPLETION = "Test Suite 'ObjectiveRecordTests.xctest' finished at 2013-12-10 06:15:42 +0000."
9
+
10
+ SAMPLE_OCUNIT_SUITE_BEGINNING = "Test Suite 'RACKVOWrapperSpec' started at 2013-12-10 21:06:10 +0000"
5
11
  SAMPLE_KIWI_SUITE_COMPLETION = "Test Suite 'All tests' finished at 2013-12-08 04:26:49 +0000."
6
12
  SAMPLE_OCUNIT_SUITE_COMPLETION = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' finished at 2013-12-08 22:09:37 +0000."
7
13
  SAMPLE_XCTEST_SUITE_COMPLETION = "Test Suite 'ObjectiveSugarTests.xctest' finished at 2013-12-09 04:42:13 +0000."
14
+
8
15
  SAMPLE_KIWI_FAILURE = "/Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49: error: -[NumberAdditions Iterators_TimesIteratesTheExactNumberOfTimes] : 'Iterators, times: iterates the exact number of times' [FAILED], expected subject to equal 4, got 5"
9
16
  SAMPLE_SPECTA_FAILURE = "/Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458: error: -[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES] : expected: 1, got: 0"
17
+
10
18
  SAMPLE_BUILD = "=== BUILD TARGET The Spacer OF PROJECT Pods WITH THE DEFAULT CONFIGURATION Debug ==="
11
19
  SAMPLE_CLEAN = "=== CLEAN TARGET Pods-ObjectiveSugar OF PROJECT Pods WITH CONFIGURATION Debug ==="
12
20
  SAMPLE_ANOTHER_CLEAN = "=== CLEAN TARGET Pods OF PROJECT Pods WITH CONFIGURATION Debug ==="
@@ -16,7 +24,7 @@ Clean.Remove clean /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSu
16
24
  builtin-rm -rf /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSugar-ayzdhqmmwtqgysdpznmovjlupqjy/Build/Intermediates/ObjectiveSugar.build/Debug-iphonesimulator/ObjectiveSugarTests.build
17
25
  )
18
26
  SAMPLE_EXECUTED_TESTS = "Executed 4 tests, with 0 failures (0 unexpected) in 0.003 (0.004) seconds"
19
- SAMPLE_OCUNIT_TEST = "Test Case '-[RACTupleSpec _tupleByAddingObject__should_add_a_non_nil_object]' passed (0.001 seconds)."
27
+ SAMPLE_OCUNIT_TEST = "Test Case '-[#{SAMPLE_TEST_GROUP_NAME} _tupleByAddingObject__should_add_a_non_nil_object]' passed (0.001 seconds)."
20
28
  SAMPLE_COMPILE = %Q(
21
29
  CompileC /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSugar-ayzdhqmmwtqgysdpznmovjlupqjy/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-ObjectiveSugar.build/Objects-normal/i386/NSMutableArray+ObjectiveSugar.o /Users/musalj/code/OSS/ObjectiveSugar/Classes/NSMutableArray+ObjectiveSugar.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
22
30
  cd /Users/musalj/code/OSS/ObjectiveSugar/Example/Pods
@@ -0,0 +1,6 @@
1
+ $:.unshift('.', __FILE__)
2
+ require "lib/xcpretty/ansi"
3
+ require "support/matchers/colors"
4
+ require "fixtures/constants"
5
+
6
+ include XCPretty::ANSI
@@ -0,0 +1,18 @@
1
+ RSpec::Matchers.define :be_colored do |expected|
2
+
3
+ def effects_string(actual)
4
+ effects = applied_effects(actual).join(' and ')
5
+ effects.length > 0 ? effects : "unformatted"
6
+ end
7
+
8
+ match do |actual|
9
+ applied_effects(actual).include? expected.to_sym
10
+ end
11
+
12
+ failure_message_for_should do |actual|
13
+ "expected that '#{strip(actual)}' would be colored #{expected}, but was #{effects_string(actual)}"
14
+ end
15
+ failure_message_for_should_not do |actual|
16
+ "expected that #{strip(actual)} would not be colored #{expected}, but was #{effects_string(actual)}"
17
+ end
18
+ end
@@ -0,0 +1,46 @@
1
+ require "xcpretty/ansi"
2
+
3
+ module XCPretty
4
+ describe ANSI do
5
+ include ANSI
6
+
7
+ before do
8
+ self.colorize = true
9
+ @text = "This is the PARTY"
10
+ end
11
+
12
+ describe "color helpers" do
13
+ it "colors text red" do
14
+ red(@text).should == "\e[31m#{@text}\e[0m"
15
+ end
16
+
17
+ it "formats text bold" do
18
+ white(@text).should == "\e[39;1m#{@text}\e[0m"
19
+ end
20
+
21
+ it "colors text green" do
22
+ green(@text).should == "\e[32;1m#{@text}\e[0m"
23
+ end
24
+
25
+ it "colors text cyan" do
26
+ cyan(@text).should == "\e[36m#{@text}\e[0m"
27
+ end
28
+ end
29
+
30
+ describe "custom color mixing" do
31
+ it "can mix random known colors" do
32
+ ansi_parse(@text, :yellow, :underline).should == "\e[33;4m#{@text}\e[0m"
33
+ end
34
+ end
35
+
36
+ describe "debug helpers" do
37
+ it "can remove formatting from text" do
38
+ strip("\e[33;4m#{@text}\e[0m").should == @text
39
+ end
40
+
41
+ it "can list known applied effects" do
42
+ applied_effects("\e[33;1m#{@text}\e[0m").should == [:yellow, :bold]
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,88 @@
1
+ require "spec_helper"
2
+ require "xcpretty/printer"
3
+
4
+ module XCPretty
5
+
6
+ module Printer
7
+
8
+ describe Printer do
9
+
10
+ include Printer
11
+
12
+ def pretty_format(text)
13
+ ""
14
+ end
15
+
16
+ def executed_tests_message
17
+ format_test_summary(SAMPLE_EXECUTED_TESTS)
18
+ end
19
+
20
+ def given_tests_are_done(reporter = SAMPLE_XCTEST_SUITE_COMPLETION)
21
+ pretty_print(reporter)
22
+ end
23
+
24
+ def given_kiwi_tests_are_done
25
+ pretty_print(SAMPLE_XCTEST_SUITE_COMPLETION)
26
+ pretty_print(SAMPLE_EXECUTED_TESTS)
27
+ pretty_print(SAMPLE_KIWI_SUITE_COMPLETION)
28
+ end
29
+
30
+ before(:each) do
31
+ STDOUT.stub(:print) { |text| text }
32
+ end
33
+
34
+ it "knows when the test suite is done for OCunit / Specta" do
35
+ executed_tests_message.should == ""
36
+
37
+ given_tests_are_done
38
+ executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
39
+ end
40
+
41
+ it "knows when the test suite is done for XCtest" do
42
+ executed_tests_message.should == ""
43
+
44
+ given_tests_are_done
45
+ executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
46
+ end
47
+
48
+ it "prints out Kiwi failures nicely" do
49
+ pretty_print(SAMPLE_KIWI_FAILURE)
50
+ pretty_print(SAMPLE_KIWI_FAILURE)
51
+ given_tests_are_done
52
+ executed_tests_message.should include(%Q(
53
+ NumberAdditions
54
+ Iterators_TimesIteratesTheExactNumberOfTimes, expected subject to equal 4, got 5
55
+ /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49
56
+
57
+ Iterators_TimesIteratesTheExactNumberOfTimes, expected subject to equal 4, got 5
58
+ /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49
59
+
60
+
61
+ #{SAMPLE_EXECUTED_TESTS}))
62
+ end
63
+
64
+ it "prints out specta failures nicely" do
65
+ pretty_print(SAMPLE_SPECTA_FAILURE)
66
+ pretty_print(SAMPLE_SPECTA_FAILURE)
67
+ given_tests_are_done
68
+ executed_tests_message.should include(%Q(
69
+ RACCommandSpec
70
+ enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0
71
+ /Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458
72
+
73
+ enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0
74
+ /Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458
75
+
76
+
77
+ #{SAMPLE_EXECUTED_TESTS}))
78
+ end
79
+
80
+ it "doesn't print executed message twice for Kiwi tests" do
81
+ Printer.instance_variable_set(:@printed_summary, false)
82
+ given_kiwi_tests_are_done
83
+ executed_tests_message.should == ""
84
+ end
85
+
86
+ end
87
+ end
88
+ end
@@ -1,5 +1,5 @@
1
+ require "spec_helper"
1
2
  require "xcpretty/printer"
2
- require "fixtures/constants"
3
3
 
4
4
  module XCPretty
5
5
 
@@ -21,8 +21,12 @@ module XCPretty
21
21
  pretty_print(reporter)
22
22
  end
23
23
 
24
+ def given_tests_have_started(reporter = SAMPLE_OCUNIT_TEST_RUN_BEGINNING)
25
+ pretty_print(reporter)
26
+ end
27
+
24
28
  def given_kiwi_tests_are_done
25
- pretty_print(SAMPLE_XCTEST_SUITE_COMPLETION)
29
+ pretty_print(SAMPLE_KIWI_TEST_RUN_COMPLETION)
26
30
  pretty_print(SAMPLE_EXECUTED_TESTS)
27
31
  pretty_print(SAMPLE_KIWI_SUITE_COMPLETION)
28
32
  end
@@ -47,31 +51,67 @@ module XCPretty
47
51
 
48
52
  it "prints out Kiwi failures nicely" do
49
53
  pretty_print(SAMPLE_KIWI_FAILURE)
50
- given_tests_are_done
54
+ pretty_print(SAMPLE_KIWI_FAILURE)
55
+ given_tests_are_done(SAMPLE_KIWI_TEST_RUN_COMPLETION)
51
56
  executed_tests_message.should include(%Q(
52
- NumberAdditions Iterators_TimesIteratesTheExactNumberOfTimes, expected subject to equal 4, got 5
53
- /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49
57
+ NumberAdditions
58
+ Iterators_TimesIteratesTheExactNumberOfTimes, expected subject to equal 4, got 5
59
+ /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49
60
+
61
+ Iterators_TimesIteratesTheExactNumberOfTimes, expected subject to equal 4, got 5
62
+ /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49
54
63
 
55
64
 
56
65
  #{SAMPLE_EXECUTED_TESTS}))
57
66
  end
58
67
 
59
68
  it "prints out specta failures nicely" do
69
+ pretty_print(SAMPLE_SPECTA_FAILURE)
60
70
  pretty_print(SAMPLE_SPECTA_FAILURE)
61
71
  given_tests_are_done
62
72
  executed_tests_message.should include(%Q(
63
- RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0
64
- /Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458
73
+ RACCommandSpec
74
+ enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0
75
+ /Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458
76
+
77
+ enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0
78
+ /Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458
65
79
 
66
80
 
67
81
  #{SAMPLE_EXECUTED_TESTS}))
68
82
  end
69
83
 
70
84
  it "doesn't print executed message twice for Kiwi tests" do
71
- Printer.instance_variable_set(:@printed_summary, false)
72
- given_kiwi_tests_are_done
73
- executed_tests_message.should == ""
85
+ given_tests_have_started(SAMPLE_KIWI_TEST_RUN_BEGINNING)
86
+ given_tests_are_done(SAMPLE_KIWI_TEST_RUN_COMPLETION)
87
+ executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
88
+
89
+ given_tests_are_done(SAMPLE_KIWI_SUITE_COMPLETION)
90
+ executed_tests_message.should == ""
91
+ end
92
+
93
+ it "prints OCunit / XCTest summary twice if tests executed twice" do
94
+ 2.times do
95
+ given_tests_have_started
96
+ given_tests_are_done
97
+ executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
98
+
99
+ given_tests_are_done(SAMPLE_XCTEST_SUITE_COMPLETION)
100
+ executed_tests_message.should == ""
101
+ end
74
102
  end
103
+
104
+ it "prints Kiwi summary twice if tests executed twice" do
105
+ 2.times do
106
+ given_tests_have_started(SAMPLE_KIWI_TEST_RUN_BEGINNING)
107
+ given_tests_are_done(SAMPLE_KIWI_TEST_RUN_COMPLETION)
108
+ executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
109
+
110
+ given_tests_are_done(SAMPLE_KIWI_SUITE_COMPLETION)
111
+ executed_tests_message.should == ""
112
+ end
113
+ end
114
+
75
115
  end
76
116
  end
77
117
  end
@@ -1,6 +1,6 @@
1
+ require "spec_helper"
1
2
  require "xcpretty/printer"
2
3
  require "xcpretty/printers/rspec"
3
- require "fixtures/constants"
4
4
 
5
5
  module XCPretty
6
6
 
@@ -13,12 +13,28 @@ module XCPretty
13
13
  subject.pretty_print(SAMPLE_OCUNIT_TEST)
14
14
  end
15
15
 
16
- it "prints dots for passing tests" do
17
- subject.pretty_format(SAMPLE_OCUNIT_TEST).should == "."
16
+ context "without colors" do
17
+
18
+ it "prints green dots for passing tests" do
19
+ subject.pretty_format(SAMPLE_OCUNIT_TEST).should == "."
20
+ end
21
+
22
+ it "prints F for failing tests" do
23
+ subject.pretty_format(SAMPLE_KIWI_FAILURE).should == "F"
24
+ end
18
25
  end
19
26
 
20
- it "prints F for failing tests" do
21
- subject.pretty_format(SAMPLE_KIWI_FAILURE).should == "F"
27
+ context "with colors" do
28
+
29
+ before { subject.colorize = true }
30
+
31
+ it "prints green for passing tests" do
32
+ subject.pretty_format(SAMPLE_OCUNIT_TEST).should be_colored :green
33
+ end
34
+
35
+ it "prints red for failing tests" do
36
+ subject.pretty_format(SAMPLE_KIWI_FAILURE).should be_colored :red
37
+ end
22
38
  end
23
39
 
24
40
  describe "doesn't output any compiling output" do
@@ -20,22 +20,22 @@ module XCPretty
20
20
 
21
21
  it "parses compiling output" do
22
22
  subject.pretty_format(SAMPLE_COMPILE).should ==
23
- "Compiling NSMutableArray+ObjectiveSugar.m"
23
+ "> Compiling NSMutableArray+ObjectiveSugar.m"
24
24
  end
25
25
 
26
26
  it "parses another compiling output" do
27
27
  subject.pretty_format(SAMPLE_ANOTHER_COMPILE).should ==
28
- "Compiling KWNull.m"
28
+ "> Compiling KWNull.m"
29
29
  end
30
30
 
31
31
  it "parses precompiling output" do
32
32
  subject.pretty_format(SAMPLE_PRECOMPILE).should ==
33
- "Precompiling Pods-CocoaLumberjack-prefix.pch"
33
+ "> Precompiling Pods-CocoaLumberjack-prefix.pch"
34
34
  end
35
35
 
36
36
  it "parses another precompiling output" do
37
37
  subject.pretty_format(SAMPLE_ANOTHER_PRECOMPILE).should ==
38
- "Precompiling Pods-CrittercismSDK-prefix.pch"
38
+ "> Precompiling Pods-CrittercismSDK-prefix.pch"
39
39
  end
40
40
 
41
41
  it "parses clean remove output" do
@@ -48,69 +48,78 @@ module XCPretty
48
48
 
49
49
  it "parses clean target/project/configuration" do
50
50
  subject.pretty_format(SAMPLE_CLEAN).should ==
51
- "Cleaning Pods/ObjectiveSugar [Debug]"
51
+ "> Cleaning Pods/ObjectiveSugar [Debug]"
52
52
  end
53
53
 
54
54
  it "parses another clean target/project/configuration" do
55
55
  subject.pretty_format(SAMPLE_ANOTHER_CLEAN).should ==
56
- "Cleaning Pods/Pods [Debug]"
56
+ "> Cleaning Pods/Pods [Debug]"
57
57
  end
58
58
 
59
59
  it "parses build target/project/configuration with target" do
60
60
  subject.pretty_format(SAMPLE_BUILD).should ==
61
- "Building Pods/The Spacer [Debug]"
61
+ "> Building Pods/The Spacer [Debug]"
62
62
  end
63
63
 
64
64
  it "parses clean target/project/configuration with nested pods" do
65
65
  subject.pretty_format(SAMPLE_CLEAN_NESTED_PODS).should ==
66
- "Cleaning Pods/Kiwi [Debug]"
66
+ "> Cleaning Pods/Kiwi [Debug]"
67
67
  end
68
68
 
69
69
  it "parses PhaseScriptExecution" do
70
70
  subject.pretty_format(SAMPLE_RUN_SCRIPT).should ==
71
- "Running script 'Check Pods Manifest.lock'"
71
+ "> Running script 'Check Pods Manifest.lock'"
72
72
  end
73
73
 
74
74
  it "parses Libtool" do
75
75
  subject.pretty_format(SAMPLE_LIBTOOL).should ==
76
- "Building library libPods-ObjectiveSugarTests-Kiwi.a"
76
+ "> Building library libPods-ObjectiveSugarTests-Kiwi.a"
77
77
  end
78
78
 
79
79
  it "parses CpResource" do
80
80
  subject.pretty_format(SAMPLE_CPRESOURCE).should ==
81
- "Copying ObjectiveSugar/Default-568h@2x.png"
81
+ "> Copying ObjectiveSugar/Default-568h@2x.png"
82
82
  end
83
83
 
84
84
  it "parses CopyStringsFile" do
85
85
  subject.pretty_format(SAMPLE_COPYSTRINGS).should ==
86
- "Copying InfoPlist.strings"
86
+ "> Copying InfoPlist.strings"
87
87
  end
88
88
 
89
89
  it "parses GenerateDSYMFile" do
90
90
  subject.pretty_format(SAMPLE_DSYM).should ==
91
- "Generating DSYM file"
91
+ "> Generating DSYM file"
92
92
  end
93
93
 
94
94
  it "parses info.plist processing" do
95
95
  subject.pretty_format(SAMPLE_PROCESS_INFOPLIST).should ==
96
- "Processing The Spacer-Info.plist"
96
+ "> Processing The Spacer-Info.plist"
97
97
  end
98
98
 
99
99
  it "parses Ld" do
100
100
  subject.pretty_format(SAMPLE_LD).should ==
101
- "Linking ObjectiveSugar"
101
+ "> Linking ObjectiveSugar"
102
102
  end
103
103
 
104
104
  it "parses passing tests" do
105
105
  subject.pretty_format(SAMPLE_OCUNIT_TEST).should ==
106
- "RACTupleSpec _tupleByAddingObject__should_add_a_non_nil_object (0.001 seconds)"
106
+ ". _tupleByAddingObject__should_add_a_non_nil_object (0.001 seconds)"
107
107
  end
108
108
 
109
109
  it "parses failing tests" do
110
110
  subject.pretty_format(SAMPLE_SPECTA_FAILURE).should ==
111
- "RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0"
111
+ "x enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0"
112
112
  end
113
113
 
114
+ it "parses test run started" do
115
+ subject.pretty_format(SAMPLE_OCUNIT_TEST_RUN_BEGINNING).should ==
116
+ "Test Suite ReactiveCocoaTests.octest(Tests) started"
117
+ end
118
+
119
+ it "parses test suite started" do
120
+ subject.pretty_format(SAMPLE_OCUNIT_SUITE_BEGINNING).should ==
121
+ "RACKVOWrapperSpec"
122
+ end
114
123
  end
115
124
  end
116
125
  end
data/xcpretty.gemspec CHANGED
@@ -26,8 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "paint"
30
-
31
29
  spec.add_development_dependency "bundler", "~> 1.3"
32
30
  spec.add_development_dependency "rake"
33
31
  spec.add_development_dependency "rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcpretty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marin Usalj
@@ -9,22 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-09 00:00:00.000000000 Z
12
+ date: 2013-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: paint
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '>='
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '>='
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: bundler
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +81,7 @@ files:
95
81
  - .gitignore
96
82
  - .kick
97
83
  - .travis.yml
84
+ - CHANGELOG.md
98
85
  - Gemfile
99
86
  - LICENSE.txt
100
87
  - README.md
@@ -105,11 +92,16 @@ files:
105
92
  - features/support/env.rb
106
93
  - features/test_format.feature
107
94
  - lib/xcpretty.rb
95
+ - lib/xcpretty/ansi.rb
108
96
  - lib/xcpretty/printer.rb
109
97
  - lib/xcpretty/printers/rspec.rb
110
98
  - lib/xcpretty/printers/simple.rb
111
99
  - lib/xcpretty/version.rb
112
100
  - spec/fixtures/constants.rb
101
+ - spec/spec_helper.rb
102
+ - spec/support/matchers/colors.rb
103
+ - spec/xcpretty/ansi_spec.rb
104
+ - spec/xcpretty/printer_spec.rb
113
105
  - spec/xcpretty/printers/printer_spec.rb
114
106
  - spec/xcpretty/printers/rspec_spec.rb
115
107
  - spec/xcpretty/printers/simple_spec.rb
@@ -144,6 +136,10 @@ test_files:
144
136
  - features/support/env.rb
145
137
  - features/test_format.feature
146
138
  - spec/fixtures/constants.rb
139
+ - spec/spec_helper.rb
140
+ - spec/support/matchers/colors.rb
141
+ - spec/xcpretty/ansi_spec.rb
142
+ - spec/xcpretty/printer_spec.rb
147
143
  - spec/xcpretty/printers/printer_spec.rb
148
144
  - spec/xcpretty/printers/rspec_spec.rb
149
145
  - spec/xcpretty/printers/simple_spec.rb