Sha256: 388ec837c2efc29869aa795544dd3c45e4e2c875e3bf606e2919bdad1edfa8dd

Contents?: true

Size: 741 Bytes

Versions: 3

Compression:

Stored size: 741 Bytes

Contents

require 'tempfile'
require 'capybara'

require 'coveralls'
Coveralls.wear!

require 'gnawrnip'

module GnawrnipTest
  def self.image(data)
    tempfile = Tempfile.new('gnarwnip_test')
    tempfile.write(data)
    tempfile.rewind
    tempfile
  end

  class Session
    def save_screenshot(file_path)
      File.open(file_path, 'w') do |fp|
        fp.print 'screenshot'
      end
    end

    def method_missing(name, *args, &block)
      # nooooooop
    end
  end
end

module Capybara
  def self.current_session
    GnawrnipTest::Session.new
  end
end

require 'rspec/core/sandbox'

RSpec.configure do |c|
  c.around :each do |ex|
    RSpec::Core::Sandbox.sandboxed do |config|
      load 'gnawrnip/rspec.rb'
      ex.run
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gnawrnip-0.8.0 spec/spec_helper.rb
gnawrnip-0.7.0 spec/spec_helper.rb
gnawrnip-0.6.0 spec/spec_helper.rb