Sha256: 61774c0d98629b5d2ae564d46c2a6a653df5e6e2c5dc21c062f21c08b07748d4

Contents?: true

Size: 358 Bytes

Versions: 9

Compression:

Stored size: 358 Bytes

Contents

# frozen_string_literal: true

module FileStubber
  def fixture_file(path, mime_type = nil, binary = false)
    config = RSpec.configuration

    if config.respond_to?(:fixture_paths) && config.fixture_paths && !File.exist?(path)
      path = File.join(config.fixture_paths, path)
    end

    Rack::Test::UploadedFile.new(path, mime_type, binary)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rider-kick-0.0.10 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.9 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.8 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.7 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.6 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.5 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.4 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.3 lib/generators/rider_kick/templates/spec/support/file_stuber.rb
rider-kick-0.0.2 lib/generators/rider_kick/templates/spec/support/file_stuber.rb