Module: RSpec::Core::World::Describable

Defined in:
lib/rspec/core/world.rb

Constant Summary collapse

PROC_HEX_NUMBER =
/0x[0-9a-f]+@/
PROJECT_DIR =
File.expand_path('.')

Instance Method Summary collapse

Instance Method Details

#descriptionObject



9
10
11
# File 'lib/rspec/core/world.rb', line 9

def description
  reject { |k, v| RSpec::Core::Configuration::CONDITIONAL_FILTERS[k] == v }.inspect.gsub(PROC_HEX_NUMBER, '').gsub(PROJECT_DIR, '.').gsub(' (lambda)','')
end

#empty?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rspec/core/world.rb', line 21

def empty?
  super rescue false
end

#empty_without_conditional_filters?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rspec/core/world.rb', line 13

def empty_without_conditional_filters?
  reject { |k, v| RSpec::Core::Configuration::CONDITIONAL_FILTERS[k] == v }.empty?
end

#rejectObject



17
18
19
# File 'lib/rspec/core/world.rb', line 17

def reject
  super rescue {}
end