Sha256: 74db36f4cfa4cdde232aba67e19b94e41bd11c85e7aef9a3087f8d8f5fbb476e

Contents?: true

Size: 661 Bytes

Versions: 11

Compression:

Stored size: 661 Bytes

Contents

require 'lurker/spy'

if defined?(RSpec) && RSpec.respond_to?(:configure)
  when_tagged_with_lurker = { :lurker => lambda { |v| !!v } }

  RSpec.configure do |config|
    config.around(:each, when_tagged_with_lurker) do |ex|
      example = ex.respond_to?(:metadata) ? ex : ex.example
      options = example.metadata[:lurker]
      options = if options.is_a?(Hash)
        options.dup
      elsif options.is_a?(String)
        { suffix: options }
      else
        {}
      end
      Lurker::Spy.on(options, &example)
    end

    unless RSpec::Core::Version::STRING > '3'
      config.treat_symbols_as_metadata_keys_with_true_values = true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lurker-0.6.12 lib/lurker/spec_helper/rspec.rb
lurker-0.6.11 lib/lurker/spec_helper/rspec.rb
lurker-0.6.10 lib/lurker/spec_helper/rspec.rb
lurker-0.6.9 lib/lurker/spec_helper/rspec.rb
lurker-0.6.8 lib/lurker/spec_helper/rspec.rb
lurker-0.6.7 lib/lurker/spec_helper/rspec.rb
lurker-0.6.6 lib/lurker/spec_helper/rspec.rb
lurker-0.6.5 lib/lurker/spec_helper/rspec.rb
lurker-0.6.4 lib/lurker/spec_helper/rspec.rb
lurker-0.6.3 lib/lurker/spec_helper/rspec.rb
lurker-0.6.2 lib/lurker/spec_helper/rspec.rb