Class: TestProf::RSpecDissect::Configuration
- Inherits:
-
Object
- Object
- TestProf::RSpecDissect::Configuration
- Defined in:
- lib/test_prof/rspec_dissect.rb
Overview
RSpecDisect configuration
Constant Summary collapse
- MODES =
%w[all let before].freeze
Instance Attribute Summary collapse
-
#let_stats_enabled ⇒ Object
(also: #let_stats_enabled?)
Returns the value of attribute let_stats_enabled.
-
#let_top_count ⇒ Object
Returns the value of attribute let_top_count.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#top_count ⇒ Object
Returns the value of attribute top_count.
Instance Method Summary collapse
- #before? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #let? ⇒ Boolean
- #stamp? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/test_prof/rspec_dissect.rb', line 45 def initialize @let_stats_enabled = true @let_top_count = (ENV['RD_PROF_LET_TOP'] || 3).to_i @top_count = (ENV['RD_PROF_TOP'] || 5).to_i @stamp = ENV['RD_PROF_STAMP'] @mode = ENV['RD_PROF'] == '1' ? 'all' : ENV['RD_PROF'] unless MODES.include?(mode) raise "Unknown RSpecDissect mode: #{mode};" \ "available modes: #{MODES.join(', ')}" end RSpecStamp.config. = @stamp if stamp? end |
Instance Attribute Details
#let_stats_enabled ⇒ Object Also known as: let_stats_enabled?
Returns the value of attribute let_stats_enabled.
38 39 40 |
# File 'lib/test_prof/rspec_dissect.rb', line 38 def let_stats_enabled @let_stats_enabled end |
#let_top_count ⇒ Object
Returns the value of attribute let_top_count.
38 39 40 |
# File 'lib/test_prof/rspec_dissect.rb', line 38 def let_top_count @let_top_count end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
43 44 45 |
# File 'lib/test_prof/rspec_dissect.rb', line 43 def mode @mode end |
#top_count ⇒ Object
Returns the value of attribute top_count.
38 39 40 |
# File 'lib/test_prof/rspec_dissect.rb', line 38 def top_count @top_count end |
Instance Method Details
#before? ⇒ Boolean
64 65 66 |
# File 'lib/test_prof/rspec_dissect.rb', line 64 def before? mode == "all" || mode == "before" end |
#let? ⇒ Boolean
60 61 62 |
# File 'lib/test_prof/rspec_dissect.rb', line 60 def let? mode == "all" || mode == "let" end |
#stamp? ⇒ Boolean
68 69 70 |
# File 'lib/test_prof/rspec_dissect.rb', line 68 def stamp? !@stamp.nil? end |