rspec_log_formatter 0.2.0 → 0.2.1

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: ae8cd95470913cdbb9dfcc428d7f681ee12ff9ba
4
- data.tar.gz: f97c4f604fecf59e017ece88b244cf030c264106
3
+ metadata.gz: 8ec13df1f1c0b2c7a1405b9030e401d587913eba
4
+ data.tar.gz: 446675cd9c5b640c9bca6b351ee8b658cdc3be4f
5
5
  SHA512:
6
- metadata.gz: 4f81eff2a175c3909a3e82a7312a02ba9b7209b3f9b794f814a2deb4c1c4df17fe4b55861eab58bf68c2f664ea77f5fbe7eef8e9300c413147ea231e06c10b3f
7
- data.tar.gz: f8f6380e8e2a059f0508f7105eab23582f6d8e14d0c59d7cab6c1e73e22a03657a2d1d23276f0e14e2c8816a58d4bc114df0d31baba3ca3c3fb28ac8a9bf5f69
6
+ metadata.gz: 8daad0901a9318e5a7ebcfb63da743deb2cd9d4ef9fcdc00301df22c00e99ba456f19cd2244dc6d8ff492c0a6610ae7f41c51b89e6f589f89d8f44af60f5f3f7
7
+ data.tar.gz: 9de5fe58628f2f2c5ee1221bf95f59f145042f518177cdb24f328a8e7cb087886cca25f730327fd44dccd9b10fba11d61222cfa510f51a30aad5d790a27d80c4
@@ -2,7 +2,7 @@ require "csv"
2
2
  require "rspec/core/formatters/base_formatter"
3
3
 
4
4
  module RspecLogFormatter
5
- class AnalyzerFormatter
5
+ class AnalyzerFormatter < RSpec::Core::Formatters::BaseFormatter
6
6
  FILENAME = "rspec.history"
7
7
 
8
8
  class Factory
@@ -10,7 +10,7 @@ module RspecLogFormatter
10
10
  @options = options
11
11
  end
12
12
 
13
- def build(output)
13
+ def build(output=$stdout)
14
14
  RspecLogFormatter::AnalyzerFormatter.new(output, {
15
15
  builds_to_analyze: nil,
16
16
  max_reruns: nil
@@ -19,6 +19,7 @@ module RspecLogFormatter
19
19
  end
20
20
 
21
21
  def initialize(output, options={})
22
+ super(output)
22
23
  @output = output
23
24
  @options = options
24
25
  end
@@ -2,7 +2,7 @@ require "csv"
2
2
  require "rspec/core/formatters/base_formatter"
3
3
 
4
4
  module RspecLogFormatter
5
- class Formatter
5
+ class Formatter < RSpec::Core::Formatters::BaseFormatter
6
6
 
7
7
  class Factory
8
8
  def initialize(options={})
@@ -10,15 +10,18 @@ module RspecLogFormatter
10
10
  end
11
11
 
12
12
  def build
13
- RspecLogFormatter::Formatter.new({
13
+ opts = {
14
14
  clock: Time,
15
15
  build_number: ENV["BUILD_NUMBER"],
16
- limit_history: nil
17
- }.merge(@options))
16
+ limit_history: nil,
17
+ output: $stdout
18
+ }.merge(@options)
19
+ RspecLogFormatter::Formatter.new(opts[:output], opts)
18
20
  end
19
21
  end
20
22
 
21
- def initialize(opts={})
23
+ def initialize(output, opts={})
24
+ super(output)
22
25
  @clock = opts[:clock]
23
26
  @build_number = opts[:build_number]
24
27
  @limit_history = opts[:limit_history]
@@ -1,3 +1,3 @@
1
1
  module RspecLogFormatter
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,7 +9,7 @@ describe RspecLogFormatter::Formatter do
9
9
  end
10
10
 
11
11
  def formatter_for_build(build, opts={})
12
- RspecLogFormatter::Formatter.new({clock: double(now: Time.at(0)), build_number: build}.merge(opts))
12
+ RspecLogFormatter::Formatter.new(nil, {clock: double(now: Time.at(0)), build_number: build}.merge(opts))
13
13
  end
14
14
 
15
15
  it "can truncate the log file" do
@@ -57,7 +57,7 @@ HEREDOC
57
57
  passed_example = make_example(2, exception: nil)
58
58
  time = Time.parse("2014-02-06 16:01:10")
59
59
  clock = FakeClock.new(time)
60
- formatter = RspecLogFormatter::Formatter.new(clock: clock)
60
+ formatter = RspecLogFormatter::Formatter.new(nil, clock: clock)
61
61
  formatter.example_started(failed_example)
62
62
  clock.now = time + 5
63
63
  formatter.example_failed(failed_example)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_log_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serguei Filimonov