Sha256: 5d7abd76e275fa435bc053df58630ec937d764a35c69af60605be30295282e71

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 Bytes

Contents

$: << File.join(File.dirname(__FILE__), "../lib")

require 'ninjs'
require 'fileutils'
require 'rspec'
require 'digest/md5'

RSpec::Matchers.define(:be_same_file_as) do |epxected_file_path|
  match do |actual_file_path|
    md5_hash(actual_file_path).should == md5_hash(epxected_file_path)
  end
  
  def md5_hash(file_path)
    Digest::MD5.hexdigest(File.read(file_path))    
  end
end

def suppress_output(&block)
  original_stdout = $stdout
  $stdout = fake = StringIO.new
  
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  
  fake.string
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ninjs-0.14.1 spec/spec_helper.rb
ninjs-0.14.0 spec/spec_helper.rb
ninjs-0.13.8 spec/spec_helper.rb