Sha256: 5386a164d93c611e22cf92c4ee914a4a86596c8d42d2f02c1485aadbbfe7ae45

Contents?: true

Size: 337 Bytes

Versions: 10

Compression:

Stored size: 337 Bytes

Contents

module IOSpecHelper
  def pretend_file_not_exists(pattern)
    allow(IO).to receive(:read).and_wrap_original do |m, *a|
      # if this isn't a good use for case equality I don't know what is
      if pattern === a.first # rubocop:disable CaseEquality
        fail Errno::ENOENT
      else
        m.call(*a)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sequel-rails-0.9.17 spec/helpers/io.rb
sequel-rails-0.9.16 spec/helpers/io.rb
sequel-rails-0.9.15 spec/helpers/io.rb
sequel-rails-0.9.14 spec/helpers/io.rb
sequel-rails-0.9.13 spec/helpers/io.rb
sequel-rails-0.9.12 spec/helpers/io.rb
sequel-rails-0.9.11 spec/helpers/io.rb
sequel-rails-0.9.10 spec/helpers/io.rb
sequel-rails-0.9.9 spec/helpers/io.rb
sequel-rails-0.9.8 spec/helpers/io.rb