Sha256: 77aa8d5c616ba9802b29927a4646f630951597027456d72f5ee24bdcf7c2e12d

Contents?: true

Size: 721 Bytes

Versions: 1

Compression:

Stored size: 721 Bytes

Contents

require_relative '../../lib/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

1 entries across 1 versions & 1 rubygems

Version Path
reek-2.1.0 spec/factories/factories.rb