Sha256: a23298fccde4732567f1faccb78c1fbcc5e0f08086f61dc866f4c1beeb759de7
Contents?: true
Size: 516 Bytes
Versions: 18
Compression:
Stored size: 516 Bytes
Contents
module FixturesHelper FIXTURES_PATH = File.expand_path("../fixtures", File.dirname(__FILE__)) def stub_fixture(path, content = nil) file = File.expand_path(path, FIXTURES_PATH) FileUtils.mkdir_p File.dirname(file) File.open(file, "w") do |f| f.print content if content yield f if block_given? end File.read(file) end def fixture_path(relative) File.expand_path(relative, FIXTURES_PATH) end def fixture(relative) File.read(fixture_path relative) end end
Version data entries
18 entries across 18 versions & 1 rubygems