parallel_formatter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 909890275a2bf8ca476c3814f54c74ef8dfe16c1
4
+ data.tar.gz: 7874f7dc97c0820c94869a86b2280f7431a9decb
5
+ SHA512:
6
+ metadata.gz: 2e97d369a4c2360ccf16f477e8d3810ad3f905faef1563a846ce429ec65d895064e1e6fa6185fba43ee5f4b27705c26c7a474ac406c410d606953b3b27abe2d2
7
+ data.tar.gz: 849744e494d4f42d56d4e49ccf6da9b563535218123ab8df90ab18402f6c46f50ed9ede9f97b176ef1b893ab54a90fdce22d0603ab86d7ee192636afc22e706f
data/.gitignore ADDED
@@ -0,0 +1,30 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+ /Gemfile.lock
12
+ .ruby-version
13
+ .idea/
14
+
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+
21
+ ## Documentation cache and generated files:
22
+ /.yardoc/
23
+ /_yardoc/
24
+ /doc/
25
+ /rdoc/
26
+
27
+ ## Environment normalisation:
28
+ /.bundle/
29
+ /vendor/bundle
30
+ /lib/bundler/man/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in parallel_formatter.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Caleb Guanzon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 cguanzon
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # ParallelFormatter
2
+
3
+ Works with RSpec 3.3.0 and up
4
+
5
+ An RSpec custom formatter that works nicely with
6
+ [parallel_tests] (https://github.com/grosser/parallel_tests).
7
+
8
+ - Patterned after DocumentFormatter
9
+ - Eliminates indentations
10
+ - Prints example description and location
11
+ - failures will instantly display info - just like
12
+ [rspec-instafail](https://github.com/grosser/rspec-instafail)
13
+
14
+ ### Example logs:
15
+ GROUP STARTED: when session is authenticated
16
+ TEST STARTED: ./spec/features/home_spec.rb:15: launches successfully
17
+ TEST PASSED: ./spec/features/home_spec.rb:15: launches successfully
18
+ GROUP STARTED: when using pre-filter thumbnails
19
+ TEST STARTED: ./spec/features/home_spec.rb:20: uses all pre-filters
20
+ TEST PASSED: ./spec/features/tutorial_spec.rb:23: I can visit the share tutorial
21
+ TEST STARTED: ./spec/features/tutorial_spec.rb:19: I can visit the import tutorial
22
+ TEST PASSED: ./spec/features/tutorial_spec.rb:19: I can visit the import tutorial
23
+ TEST STARTED: ./spec/features/tutorial_spec.rb:15: I can visit the find tutorial
24
+ TEST PASSED: ./spec/features/tutorial_spec.rb:15: I can visit the find tutorial
25
+
26
+
27
+ ## Installation
28
+
29
+ Add this line to your application's Gemfile:
30
+
31
+ ```ruby
32
+ gem 'parallel_formatter'
33
+ ```
34
+
35
+ And then execute:
36
+
37
+ $ bundle
38
+
39
+ Or install it yourself as:
40
+
41
+ $ gem install parallel_formatter
42
+
43
+ ## Usage
44
+ add to your `.rspec` file
45
+
46
+ --require parallel_formatter
47
+ --format ParallelFormatter
48
+
49
+ ## Contributing
50
+
51
+ 1. Fork it ( https://github.com/[my-github-username]/parallel_formatter/fork )
52
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
53
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
54
+ 4. Push to the branch (`git push origin my-new-feature`)
55
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,3 @@
1
+ module ParallelFormatter
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,74 @@
1
+ require "parallel_formatter/version"
2
+ require 'rspec/core/formatters/base_text_formatter'
3
+
4
+ module ParallelFormatter
5
+ class ParallelFormatter < RSpec::Core::Formatters::BaseTextFormatter
6
+ RSpec::Core::Formatters.register self, :example_group_started, :example_started,
7
+ :example_passed, :example_pending,
8
+ :example_failed
9
+
10
+ def initialize(output)
11
+ super
12
+ @failed_examples = []
13
+ end
14
+
15
+ def example_group_started(notification)
16
+ output.puts "GROUP STARTED: #{notification.group.description.strip}"
17
+ end
18
+
19
+ def example_started(notification)
20
+ output.puts "TEST STARTED: #{notification.example.location}: " \
21
+ "#{notification.example.description}"
22
+ end
23
+
24
+ def example_passed(passed)
25
+ output.puts passed_output(passed.example)
26
+ end
27
+
28
+ def example_pending(pending)
29
+ output.puts pending_output(pending.example,
30
+ pending.example.execution_result.pending_message)
31
+ end
32
+
33
+ def example_failed(failure)
34
+ @failed_examples << failure.example
35
+ output.puts failure_output(failure.example,
36
+ failure.example.execution_result.exception)
37
+ output.puts failure.fully_formatted(@failed_examples.size)
38
+ end
39
+
40
+ private
41
+
42
+ def passed_output(example)
43
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
44
+ 'TEST PASSED: ' \
45
+ "#{example.location}: " \
46
+ " #{example.description.strip}",
47
+ :success
48
+ )
49
+ end
50
+
51
+ def pending_output(example, message)
52
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
53
+ 'TEST PENDING: ' \
54
+ "#{example.location}: " \
55
+ "#{example.description.strip} (PENDING: #{message})",
56
+ :pending
57
+ )
58
+ end
59
+
60
+ def failure_output(example, _exception)
61
+ RSpec::Core::Formatters::ConsoleCodes.wrap(
62
+ 'TEST FAILED: ' \
63
+ "#{example.location}: " \
64
+ "#{example.description.strip} (FAILED - #{next_failure_index})",
65
+ :failure
66
+ )
67
+ end
68
+
69
+ def next_failure_index
70
+ @next_failure_index ||= 0
71
+ @next_failure_index += 1
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'parallel_formatter/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "parallel_formatter"
8
+ spec.version = ParallelFormatter::VERSION
9
+ spec.authors = ["Caleb Guanzon"]
10
+ spec.email = ["calebguanzon@gmail.com"]
11
+ spec.summary = %q{Another RSpec custom formatter.}
12
+ spec.description = %q{An RSpec custom formatter that works nicely with parallel_tests.}
13
+ spec.homepage = "https://github.com/cguanzon/parallel_formatter"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "rspec", "~> 3.3.0"
22
+ spec.add_development_dependency "bundler", "~> 1.6"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: parallel_formatter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Caleb Guanzon
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: An RSpec custom formatter that works nicely with parallel_tests.
56
+ email:
57
+ - calebguanzon@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - lib/parallel_formatter.rb
69
+ - lib/parallel_formatter/version.rb
70
+ - parallel_formatter.gemspec
71
+ homepage: https://github.com/cguanzon/parallel_formatter
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.2.2
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Another RSpec custom formatter.
95
+ test_files: []
96
+ has_rdoc: