super_profile 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rspec/super_profile.rb +12 -4
  2. metadata +14 -3
@@ -22,8 +22,7 @@ module RSpec
22
22
  super
23
23
  @example_times << [
24
24
  true,
25
- # RSpec::Core::Formatters::BaseFormatter.relative_path(example.location),
26
- RSpec::Core::Metadata::relative_path(example.location),
25
+ example_loc(example),
27
26
  example.description,
28
27
  Time.now - @time
29
28
  ]
@@ -33,8 +32,7 @@ module RSpec
33
32
  super
34
33
  @example_times << [
35
34
  false,
36
- # RSpec::Core::Formatters::BaseFormatter.relative_path(example.location),
37
- RSpec::Core::Metadata::relative_path(example.location),
35
+ example_loc(example),
38
36
  example.description,
39
37
  Time.now - @time
40
38
  ]
@@ -75,6 +73,16 @@ module RSpec
75
73
  def sorted_by_time(times)
76
74
  times.to_a.sort_by{|x| x.last}.reverse.reject{|x| x.last < SHOW_ABOVE}
77
75
  end
76
+
77
+ def example_loc(example)
78
+ # handle rspec <= 2.7 gracefully
79
+ if RSpec::Core::Metadata.respond_to?(:relative_path)
80
+ RSpec::Core::Metadata::relative_path(example.location) # RSpec 2.10
81
+ else
82
+ RSpec::Core::Formatters::BaseFormatter.relative_path(example.location) # RSpec 2.7
83
+ end
84
+ end
85
+
78
86
  end
79
87
 
80
88
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_profile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-core
16
- requirement: &70118534455560 !ruby/object:Gem::Requirement
16
+ requirement: &70243675970460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,18 @@ dependencies:
21
21
  version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70118534455560
24
+ version_requirements: *70243675970460
25
+ - !ruby/object:Gem::Dependency
26
+ name: cucumber
27
+ requirement: &70243675970060 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70243675970060
25
36
  description: enhanced speed profile formatter for rspec and cucumber
26
37
  email:
27
38
  - bmishkin@mac.com