Sha256: 1634266de24e2e954847e26a4ba8a22155880bb1c00a80c175d2d6a1d3df3611

Contents?: true

Size: 827 Bytes

Versions: 5

Compression:

Stored size: 827 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

5 entries across 5 versions & 1 rubygems

Version Path
shellshot-0.4.0 spec/spec_helper.rb
shellshot-0.3.1 spec/spec_helper.rb
shellshot-0.3.0 spec/spec_helper.rb
shellshot-0.2.0 spec/spec_helper.rb
shellshot-0.1.0 spec/spec_helper.rb