Sha256: 387819c63fcf45eb3bc54ca1f1aff9c2fbf58ebde87856754d1cceb4a772f97f

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

require File.expand_path(
    File.join(File.dirname(__FILE__), %w[.. lib shellshot]))

require 'tmpdir'
require 'rubygems'
require 'ruby-debug'

Spec::Matchers.define :be_a_file do
  match do |path|
    File.exists?(path)
  end
end

Spec::Matchers.define :contain do |contents|
  match do |path|
    File.exists?(path) && File.read(path).strip == contents
  end

  failure_message_for_should do |path|
    if File.exists?(path)
      "expected #{path} to contain '#{contents}', got '#{File.read(path).strip}'"
    else
      "expected #{path} to contain '#{contents}', but the file does not exist."
    end
  end
end

Spec::Runner.configure do |config|
  config.before(:each) do
    @tmpdir = Dir.mktmpdir
    Dir.chdir(@tmpdir)
  end

  config.after(:each) do
    FileUtils.remove_entry_secure @tmpdir
  end

end



# EOF

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shellshot-0.4.3 spec/spec_helper.rb
shellshot-0.4.2 spec/spec_helper.rb
shellshot-0.4.1 spec/spec_helper.rb