Sha256: 61a87edf1bfbc41f161b5477f4a2b43bec6814cdd42d0fbd67fc2503e03ad267

Contents?: true

Size: 702 Bytes

Versions: 3

Compression:

Stored size: 702 Bytes

Contents

require 'reek/smells'

FactoryGirl.define do
  factory :smell_detector, class: Reek::Smells::SmellDetector do
    skip_create
    transient do
      smell_type 'FeatureEnvy'
    end
    source 'dummy_file'

    initialize_with do
      ::Reek::Smells.const_get(smell_type).new(source)
    end
  end

  factory :smell_warning, class: Reek::SmellWarning do
    skip_create
    smell_detector
    context 'self'
    lines [42]
    message 'smell warning message'
    parameters { {} }

    initialize_with do
      new(smell_detector, context: context,
                          lines: lines,
                          message: message,
                          parameters: parameters)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-2.0.4 spec/factories/factories.rb
reek-2.0.3 spec/factories/factories.rb
reek-2.0.2 spec/factories/factories.rb