Class: Rspec::PendingFor::Build
- Inherits:
-
Object
- Object
- Rspec::PendingFor::Build
- Defined in:
- lib/rspec/pending_for/build.rb
Overview
SRP: Describe the RubyEngine and/or RubyVersion(s) that will be pended or skipped and with what message
Constant Summary collapse
- INTERPRETER_MATRIX =
Keys are the
{ 'unknown' => 'MRI < 1.9 (probably)', 'ruby' => 'MRI >= 1.9', 'ree' => 'Ruby Enterprise Edition', 'jruby' => 'JRuby', 'macruby' => 'MacRuby', 'rbx' => 'Rubinius', 'maglev' => 'MagLev', 'ironruby' => 'IronRuby', 'cardinal' => 'Cardinal' }.freeze
- BROKEN_STRING =
'Behavior is broken'
- BUG_STRING =
'due to a bug in the Ruby engine'
- VERSIONS_STRING =
'in Ruby versions'
- ISSUES_LINK =
'https://github.com/pboling/rspec-pending_for/issues'
- RELEVANT_VERSIONS_PROC =
lambda { |rv| "#{BROKEN_STRING} #{VERSIONS_STRING} #{rv} #{BUG_STRING}" }
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#relevant_engine ⇒ Object
readonly
Returns the value of attribute relevant_engine.
-
#relevant_versions ⇒ Object
readonly
Returns the value of attribute relevant_versions.
Instance Method Summary collapse
- #current_matches_specified? ⇒ Boolean
-
#initialize(options = {}) ⇒ Build
constructor
A new instance of Build.
Constructor Details
#initialize(options = {}) ⇒ Build
Returns a new instance of Build.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rspec/pending_for/build.rb', line 41 def initialize( = {}) @relevant_versions = Array([:versions]) # cast to array @relevant_engine = [:engine].nil? ? nil : [:engine].to_s @reason = [:reason] warn_about_unrecognized_engine # If engine is nil, then any matching versions should be pended @message = if @relevant_engine.nil? no_engine_specified elsif RubyEngine.is? @relevant_engine engine_specified_and_relevant end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
39 40 41 |
# File 'lib/rspec/pending_for/build.rb', line 39 def @message end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
39 40 41 |
# File 'lib/rspec/pending_for/build.rb', line 39 def reason @reason end |
#relevant_engine ⇒ Object (readonly)
Returns the value of attribute relevant_engine.
39 40 41 |
# File 'lib/rspec/pending_for/build.rb', line 39 def relevant_engine @relevant_engine end |
#relevant_versions ⇒ Object (readonly)
Returns the value of attribute relevant_versions.
39 40 41 |
# File 'lib/rspec/pending_for/build.rb', line 39 def relevant_versions @relevant_versions end |
Instance Method Details
#current_matches_specified? ⇒ Boolean
54 55 56 |
# File 'lib/rspec/pending_for/build.rb', line 54 def current_matches_specified? !.nil? end |