Ticket #457 (closed defect: duplicate)

Opened 11 months ago

Last modified 10 months ago

[PATCH] Fixtures helper looks in wrong location for fixtures

Reported by: dermot.brenn..@gmail.com Assigned to:
Priority: major Milestone: The Future
Component: Rspec Harness Keywords: fixtures, rspec
Cc:

Description

The current fixtures helper function in merb/test/helper.rb assumes that fixtures are in File.dirname(FILE) + "/fixtures/#{name}.yaml". Which is a strange location.

The attached patch looks at the use_test variable defined in dependencies.rb to figure out which testing framework is preferred.

If using rspec it looks in Merb.root/spec/fixtures If using test_unit it looks in Merb.root/test/fixtures

test_unit is the default.

The patch also creates accessor methods and instance variables for the given fixtures.

WARNING: I haven't tested this method fully because I get the following error when I try to use the existing fixtures method.

undefined method `fixtures' for Spec::Example::ExampleGroup::Subclass_1:Class

Attachments

fixtures_helper_patch.diff (1.4 kB) - added by dermot.brenn..@gmail.com on 01/15/08 04:32:02.

Change History

01/15/08 04:32:02 changed by dermot.brenn..@gmail.com

  • attachment fixtures_helper_patch.diff added.

01/15/08 04:32:38 changed by dermot.brenn..@gmail.com

  • summary changed from [PATCH] Fixtures helper assumes to [PATCH] Fixtures helper looks in wrong location for fixtures.

02/11/08 13:31:41 changed by shayarne..@gmail.com

  • status changed from new to closed.
  • resolution set to duplicate.