xcpretty 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,78 @@
1
+ require "xcpretty/printer"
2
+ require "fixtures/constants"
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
+ given_tests_are_done
51
+ 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
54
+
55
+
56
+ #{SAMPLE_EXECUTED_TESTS}))
57
+ end
58
+
59
+ it "prints out specta failures nicely" do
60
+ pretty_print(SAMPLE_SPECTA_FAILURE)
61
+ given_tests_are_done
62
+ 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
65
+
66
+
67
+ #{SAMPLE_EXECUTED_TESTS}))
68
+ end
69
+
70
+ 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 == ""
74
+ end
75
+
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,36 @@
1
+ require "xcpretty/printer"
2
+ require "xcpretty/printers/rspec"
3
+ require "fixtures/constants"
4
+
5
+ module XCPretty
6
+
7
+ module Printer
8
+
9
+ describe RSpec do
10
+
11
+ it "prints dots in the same line" do
12
+ STDOUT.should receive(:print)
13
+ subject.pretty_print(SAMPLE_OCUNIT_TEST)
14
+ end
15
+
16
+ it "prints dots for passing tests" do
17
+ subject.pretty_format(SAMPLE_OCUNIT_TEST).should == "."
18
+ end
19
+
20
+ it "prints F for failing tests" do
21
+ subject.pretty_format(SAMPLE_KIWI_FAILURE).should == "F"
22
+ end
23
+
24
+ describe "doesn't output any compiling output" do
25
+
26
+ it "compiling output" do
27
+ subject.pretty_format(SAMPLE_COMPILE).should == ""
28
+ end
29
+
30
+ it "clean target/project/configuration with nested pods" do
31
+ subject.pretty_format(SAMPLE_CLEAN).should == ""
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,116 @@
1
+ require "xcpretty/printer"
2
+ require "xcpretty/printers/simple"
3
+ require "fixtures/constants"
4
+
5
+ module XCPretty
6
+
7
+ module Printer
8
+
9
+ describe Simple do
10
+
11
+ it "prints to stdout" do
12
+ STDOUT.should receive(:print)
13
+ subject.pretty_print(SAMPLE_CLEAN)
14
+ end
15
+
16
+ it "doesn't print empty lines" do
17
+ STDOUT.should_not receive(:print)
18
+ subject.pretty_print("")
19
+ end
20
+
21
+ it "parses compiling output" do
22
+ subject.pretty_format(SAMPLE_COMPILE).should ==
23
+ "Compiling NSMutableArray+ObjectiveSugar.m"
24
+ end
25
+
26
+ it "parses another compiling output" do
27
+ subject.pretty_format(SAMPLE_ANOTHER_COMPILE).should ==
28
+ "Compiling KWNull.m"
29
+ end
30
+
31
+ it "parses precompiling output" do
32
+ subject.pretty_format(SAMPLE_PRECOMPILE).should ==
33
+ "Precompiling Pods-CocoaLumberjack-prefix.pch"
34
+ end
35
+
36
+ it "parses another precompiling output" do
37
+ subject.pretty_format(SAMPLE_ANOTHER_PRECOMPILE).should ==
38
+ "Precompiling Pods-CrittercismSDK-prefix.pch"
39
+ end
40
+
41
+ it "parses clean remove output" do
42
+ subject.pretty_format(SAMPLE_CLEAN_REMOVE).should == ""
43
+ end
44
+
45
+ it "kills 'Check dependencies'" do
46
+ subject.pretty_format("Check dependencies").should == ""
47
+ end
48
+
49
+ it "parses clean target/project/configuration" do
50
+ subject.pretty_format(SAMPLE_CLEAN).should ==
51
+ "Cleaning Pods/ObjectiveSugar [Debug]"
52
+ end
53
+
54
+ it "parses another clean target/project/configuration" do
55
+ subject.pretty_format(SAMPLE_ANOTHER_CLEAN).should ==
56
+ "Cleaning Pods/Pods [Debug]"
57
+ end
58
+
59
+ it "parses build target/project/configuration with target" do
60
+ subject.pretty_format(SAMPLE_BUILD).should ==
61
+ "Building Pods/The Spacer [Debug]"
62
+ end
63
+
64
+ it "parses clean target/project/configuration with nested pods" do
65
+ subject.pretty_format(SAMPLE_CLEAN_NESTED_PODS).should ==
66
+ "Cleaning Pods/Kiwi [Debug]"
67
+ end
68
+
69
+ it "parses PhaseScriptExecution" do
70
+ subject.pretty_format(SAMPLE_RUN_SCRIPT).should ==
71
+ "Running script 'Check Pods Manifest.lock'"
72
+ end
73
+
74
+ it "parses Libtool" do
75
+ subject.pretty_format(SAMPLE_LIBTOOL).should ==
76
+ "Building library libPods-ObjectiveSugarTests-Kiwi.a"
77
+ end
78
+
79
+ it "parses CpResource" do
80
+ subject.pretty_format(SAMPLE_CPRESOURCE).should ==
81
+ "Copying ObjectiveSugar/Default-568h@2x.png"
82
+ end
83
+
84
+ it "parses CopyStringsFile" do
85
+ subject.pretty_format(SAMPLE_COPYSTRINGS).should ==
86
+ "Copying InfoPlist.strings"
87
+ end
88
+
89
+ it "parses GenerateDSYMFile" do
90
+ subject.pretty_format(SAMPLE_DSYM).should ==
91
+ "Generating DSYM file"
92
+ end
93
+
94
+ it "parses info.plist processing" do
95
+ subject.pretty_format(SAMPLE_PROCESS_INFOPLIST).should ==
96
+ "Processing The Spacer-Info.plist"
97
+ end
98
+
99
+ it "parses Ld" do
100
+ subject.pretty_format(SAMPLE_LD).should ==
101
+ "Linking ObjectiveSugar"
102
+ end
103
+
104
+ it "parses passing tests" do
105
+ subject.pretty_format(SAMPLE_OCUNIT_TEST).should ==
106
+ "RACTupleSpec _tupleByAddingObject__should_add_a_non_nil_object (0.001 seconds)"
107
+ end
108
+
109
+ it "parses failing tests" do
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"
112
+ end
113
+
114
+ end
115
+ end
116
+ end
data/xcpretty.gemspec ADDED
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'xcpretty/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "xcpretty"
8
+ spec.version = XCPretty::VERSION
9
+ spec.authors = ["Marin Usalj", "Delisa Mason"]
10
+ spec.email = ["mneorr@gmail.com", "kattrali@gmail.com"]
11
+ spec.description =
12
+ %q{
13
+ Xcodebuild formatter designed to be piped with `xcodebuild`,
14
+ and thus keeping 100% compatibility.
15
+
16
+ It has modes for CI, running tests (RSpec dot-style),
17
+ and it can also mine Bitcoins.
18
+ }
19
+ spec.summary = %q{xcodebuild formatter done right}
20
+ spec.homepage = "https://github.com/mneorr/xcpretty"
21
+ spec.license = "MIT"
22
+
23
+ spec.files = `git ls-files`.split($/)
24
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
25
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_dependency "paint"
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.3"
31
+ spec.add_development_dependency "rake"
32
+ spec.add_development_dependency "rspec"
33
+ spec.add_development_dependency "cucumber"
34
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcpretty
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marin Usalj
8
+ - Delisa Mason
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-12-09 00:00:00.000000000 Z
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
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '1.3'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: '1.3'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: cucumber
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ description: "\n Xcodebuild formatter designed to be piped with `xcodebuild`,\n and
85
+ thus keeping 100% compatibility.\n\n It has modes for CI, running tests (RSpec
86
+ dot-style),\n and it can also mine Bitcoins.\n "
87
+ email:
88
+ - mneorr@gmail.com
89
+ - kattrali@gmail.com
90
+ executables:
91
+ - xcpretty
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - .gitignore
96
+ - .kick
97
+ - .travis.yml
98
+ - Gemfile
99
+ - LICENSE.txt
100
+ - README.md
101
+ - Rakefile
102
+ - bin/xcpretty
103
+ - features/simple_format.feature
104
+ - features/steps/formatting_steps.rb
105
+ - features/support/env.rb
106
+ - features/test_format.feature
107
+ - lib/xcpretty.rb
108
+ - lib/xcpretty/printer.rb
109
+ - lib/xcpretty/printers/rspec.rb
110
+ - lib/xcpretty/printers/simple.rb
111
+ - lib/xcpretty/version.rb
112
+ - spec/fixtures/constants.rb
113
+ - spec/fixtures/sample_xctool_output
114
+ - spec/xcpretty/printers/printer_spec.rb
115
+ - spec/xcpretty/printers/rspec_spec.rb
116
+ - spec/xcpretty/printers/simple_spec.rb
117
+ - xcpretty.gemspec
118
+ homepage: https://github.com/mneorr/xcpretty
119
+ licenses:
120
+ - MIT
121
+ metadata: {}
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '>='
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 2.0.3
139
+ signing_key:
140
+ specification_version: 4
141
+ summary: xcodebuild formatter done right
142
+ test_files:
143
+ - features/simple_format.feature
144
+ - features/steps/formatting_steps.rb
145
+ - features/support/env.rb
146
+ - features/test_format.feature
147
+ - spec/fixtures/constants.rb
148
+ - spec/fixtures/sample_xctool_output
149
+ - spec/xcpretty/printers/printer_spec.rb
150
+ - spec/xcpretty/printers/rspec_spec.rb
151
+ - spec/xcpretty/printers/simple_spec.rb
152
+ has_rdoc: