Module: Uninhibited::BackgroundMetadata

Defined in:
lib/uninhibited/background_metadata.rb

Overview

Extension for RSpec::Core::Metadata to include background step definitions even when running filtered actions.

Instance Method Summary collapse

Instance Method Details

#all_apply_or_background?(filters) ⇒ Boolean

When running a filtered set of steps, we still want to run the background steps, so we need a custom method for handling this case.

Returns:

  • (Boolean)


8
9
10
11
12
13
14
# File 'lib/uninhibited/background_metadata.rb', line 8

def all_apply_or_background?(filters)
  if filters[:include_background] && self[:background]
    true
  else
    rspec_all_apply?(filters.reject { |k,| k == :include_background })
  end
end