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

Version Path
jax-3.0.0.rc2 spec/support/fixtures_helper.rb
jax-2.0.12 spec/support/fixtures_helper.rb
jax-3.0.0.rc1 spec/support/fixtures_helper.rb
jax-2.0.11 spec/support/fixtures_helper.rb
jax-2.0.10 spec/support/fixtures_helper.rb
jax-2.0.9 spec/support/fixtures_helper.rb
jax-2.0.8 spec/support/fixtures_helper.rb
jax-2.0.7 spec/support/fixtures_helper.rb
jax-2.0.6 spec/support/fixtures_helper.rb
jax-2.0.5 spec/support/fixtures_helper.rb
jax-2.0.4 spec/support/fixtures_helper.rb
jax-2.0.3 spec/support/fixtures_helper.rb
jax-2.0.2 spec/support/fixtures_helper.rb
jax-2.0.1 spec/support/fixtures_helper.rb
jax-2.0.0 spec/support/fixtures_helper.rb
jax-1.1.1 spec/support/fixtures_helper.rb
jax-1.1.0 spec/support/fixtures_helper.rb
jax-1.1.0.rc1 spec/support/fixtures_helper.rb