Sha256: d8e3b40d99ae67549e577d807e60d3b51a2a14e74c1c8c990c9ab4cc2d752e37

Contents?: true

Size: 895 Bytes

Versions: 6

Compression:

Stored size: 895 Bytes

Contents

require "minitest/autorun"
require "fileutils"
require "stringio"
require "rack/mock"

require "lanyon"


TEST_DIR = File.expand_path("..", __FILE__)
TEMP_DIR = File.join(TEST_DIR, "tmp")


def setup_tempdir
  FileUtils.mkdir_p(TEMP_DIR)

  File.exist?(TEMP_DIR) ? TEMP_DIR : nil
end

def teardown_tempdir
  FileUtils.rm_rf(TEMP_DIR)  if File.exist?(TEMP_DIR)
end

def chdir_tempdir
  Dir.chdir(TEMP_DIR)
end

def sourcedir
  File.join(TEST_DIR, "source")
end


def silence_output
  original_stderr, original_stdout = $stderr, $stdout
  $stderr, $stdout = StringIO.new, StringIO.new

  yield
ensure
  $stderr, $stdout = original_stderr, original_stdout
end


def file_must_exist(filename)
  assert File.exist?(filename),
         "Expected file `#{filename}' to exist."
end

def file_wont_exist(filename)
  assert !File.exist?(filename),
         "Expected file `#{filename}' to not exist."
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lanyon-0.4.0 test/helper.rb
lanyon-0.3.4 test/helper.rb
lanyon-0.3.3 test/helper.rb
lanyon-0.3.2 test/helper.rb
lanyon-0.3.1 test/helper.rb
lanyon-0.3.0 test/helper.rb