rspec_pretty_report 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,11 +12,15 @@ class Oopsy
12
12
  attr_reader :klass, :message, :backtrace, :highlighted_source, :explanation, :backtrace_message
13
13
 
14
14
  def initialize(exception, file_path)
15
- @exception ||= exception
16
- @file_path ||= file_path
15
+ @exception = exception
16
+ @file_path = file_path
17
17
  unless @exception.nil?
18
18
  @klass = @exception.class
19
+ if @exception.message.frozen?
20
+ @message = @exception.message.dup.force_encoding('utf-8')
21
+ else
19
22
  @message = @exception.message.force_encoding('utf-8')
23
+ end
20
24
  @backtrace = @exception.backtrace
21
25
  @backtrace_message = @backtrace.select { |r| r.match(@file_path) }.join('').force_encoding('utf-8')
22
26
  @highlighted_source = process_source
@@ -79,7 +83,7 @@ class Example
79
83
  attr_reader :description, :full_description, :run_time, :duration, :status, :exception, :file_path, :metadata, :spec
80
84
 
81
85
  def initialize(example)
82
- @description ||= example.description
86
+ @description = example.description
83
87
  @full_description = example.full_description
84
88
  @execution_result = example.execution_result
85
89
  @run_time = (@execution_result[:run_time]).round(5)
@@ -165,11 +169,7 @@ class RspecPrettyReport < RSpec::Core::Formatters::BaseFormatter
165
169
 
166
170
  def example_failed(example)
167
171
  @group_example_failure_count += 1
168
- begin
169
172
  @group_examples << Example.new(example)
170
- rescue RuntimeError
171
- puts "example initialize failed"
172
- end
173
173
  end
174
174
 
175
175
  def example_pending(example)
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rspec_pretty_report"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.require_paths = ["lib"]
12
12
  s.authors = ["Tim sheng"]
13
- s.date = "2014-10-17"
13
+ s.date = "2014-10-21"
14
14
  s.description = "A more pretty html report for rspec"
15
15
  s.email = "278570038@qq.com"
16
16
  s.files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_pretty_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-17 00:00:00.000000000 Z
12
+ date: 2014-10-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A more pretty html report for rspec
15
15
  email: 278570038@qq.com