rf-web/vendor/bundle/gems/sassc-2.2.1/test/test_helper.rb

46 lines
800 B
Ruby
Raw Normal View History

2019-10-21 08:18:17 +00:00
# frozen_string_literal: true
require "minitest/autorun"
require "minitest/pride"
require "minitest/around/unit"
require "test_construct"
require "pry"
require "sassc"
module FixtureHelper
FIXTURE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "fixtures"))
def fixture(path)
IO.read(fixture_path(path))
end
def fixture_path(path)
if path.match(FIXTURE_ROOT)
path
else
File.join(FIXTURE_ROOT, path)
end
end
end
module TempFileTest
include TestConstruct::Helpers
def around
within_construct do |construct|
@construct = construct
yield
end
@construct = nil
end
def temp_file(filename, contents)
@construct.file(filename, contents)
end
def temp_dir(directory)
@construct.directory(directory)
end
end