Skip to content

Instantly share code, notes, and snippets.

@sapslaj
Created November 6, 2015 14:49
Show Gist options
  • Select an option

  • Save sapslaj/3035373e440de070090e to your computer and use it in GitHub Desktop.

Select an option

Save sapslaj/3035373e440de070090e to your computer and use it in GitHub Desktop.
Very simple test fixture implementation.
# Put this in your test_helper or spec_helper and add fixtures to 'fixtures.yml'
def fixture(*keys)
@fixtures ||= YAML.load(File.read(File.join(File.dirname(__FILE__), 'fixtures.yml')))
last_path = @fixtures
keys.each { |key| last_path = last_path[key] }
last_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment