Class: RSpec::RequestableExamples::RequestedExamples

Inherits:
Array
  • Object
show all
Defined in:
lib/rspec/requestable-examples.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ RequestedExamples

Returns a new instance of RequestedExamples.



6
7
8
9
10
# File 'lib/rspec/requestable-examples.rb', line 6

def initialize(options)
  options ||= {}
  @do_not_run_any_examples = true if options[:examples] == []
  replace options[:examples] || []
end

Instance Method Details

#run?(example) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/rspec/requestable-examples.rb', line 12

def run?(example)
  return false if @do_not_run_any_examples
  return true if empty? || include?(example)
  false
end