class Rspec::PendingFor::Build
SRP: Describe the RubyEngine and/or RubyVersion(s) that will be pended or skipped and with what message
Constants
- BROKEN_STRING
- BUG_STRING
- INTERPRETER_MATRIX
Keys are the
- ISSUES_LINK
- VERSIONS_STRING
Attributes
message[R]
reason[R]
relevant_engine[R]
relevant_versions[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/rspec/pending_for/build.rb, line 39 def initialize(options = {}) @relevant_versions = Array(options[:versions]) # cast to array @relevant_engine = options[:engine].nil? ? nil : options[:engine].to_s @reason = options[: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
Public Instance Methods
current_matches_specified?()
click to toggle source
# File lib/rspec/pending_for/build.rb, line 52 def current_matches_specified? !message.nil? end
Private Instance Methods
engine_specified_and_relevant()
click to toggle source
# File lib/rspec/pending_for/build.rb, line 74 def engine_specified_and_relevant if relevant_versions.empty? # No versions specified means ALL versions for this engine reason || "#{BROKEN_STRING} #{BUG_STRING} #{INTERPRETER_MATRIX[relevant_engine]}" else if relevant_versions.include?(RubyVersion.to_s) reason || %Q[#{BROKEN_STRING} #{VERSIONS_STRING} #{relevant_versions} #{BUG_STRING} (#{INTERPRETER_MATRIX[relevant_engine]})] else nil # Not a pended/skipped spec end end end
no_engine_specified()
click to toggle source
# File lib/rspec/pending_for/build.rb, line 66 def no_engine_specified if relevant_versions.include?(RubyVersion.to_s) reason || "#{BROKEN_STRING} #{VERSIONS_STRING} #{relevant_versions} #{BUG_STRING}" else nil # Not a pended/skipped spec end end
warn_about_unrecognized_engine()
click to toggle source
# File lib/rspec/pending_for/build.rb, line 58 def warn_about_unrecognized_engine return false if relevant_engine.nil? || !INTERPRETER_MATRIX[relevant_engine].nil? warn %Q[ Engine specified (#{relevant_engine}) is not known to rspec-pending_for. If it is a real RUBY_ENGINE, please report as a bug to #{ISSUES_LINK} ] end