I can''t get fixtures to load correctly in a Mosquito test. The first fixture loads in the unit test, but the rest don''t load at all. File structure: tracker/ tracker.rb test/ test_tracker.rb fixtures/ tracker_measurements.yml tracker_projects.yml Relevant test code: require ''rubygems'' require ''mosquito'' require File.dirname(__FILE__) + "/../tracker" Tracker.create include Tracker::Models ... class TestMeasurement < Camping::UnitTest fixtures :tracker_measurements, :tracker_projects ... def test_should_have_project measurement = Measurement.find 1 assert_kind_of Project, measurement.project # measurement.project is always nilClass assert_equal measurement.project_id, measurement.project.id end ... end The test.log shows that tracker_measurements.yml is loaded, but tracker_projects.yml never is touched. I know the relationship works because I''m using it in the application already, and I also cannot load any other fixtures, no matter the name. Any help would be greatly appreciated, Josh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20070627/24c3dddd/attachment.html
On 6/27/07, Joshua Schairbaum <joshua.schairbaum at gmail.com> wrote:> > I can''t get fixtures to load correctly in a Mosquito test. The first > fixture loads in the unit test, but the rest don''t load at all.I actually ran into a similar problem, although none of my fixtures were loaded at all. On running the example blog tests included with mosquito, there were a number of failures which appeared related to to the non-loading fixtures. I found that changing "change_fixtures" to "self.fixtures" on line 25 of mosquito.rb solved the problem for me, though I don''t know enough about Camping, Mosquito, and ActiveRecord to know if this is the best fix or not. Regards, Alpha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20070627/ecc602af/attachment.html
> On 6/27/07, Joshua Schairbaum <joshua.schairbaum at gmail.com> wrote: > > I can''t get fixtures to load correctly in a Mosquito test. The first > fixture loads in the unit test, but the rest don''t load at all.I haven''t touched Mosquito in a while. I''ve actually hacked out a simple BDD library for Camping using RSpec, but haven''t polished it up for release yet. -- Geoffrey Grosenbach ........................ Screencast | http://peepcode.com
I''ve determined that I''m not even reaching the "create_fixtures" method when calling a test. Very perplexing... I''m wondering if using an older version of Active Record would solve it temporarily. I''m assuming that there''s been a change to the way the that fixtures are loaded in Rails, and the change hasn''t filtered down yet. :) Josh On 6/27/07, Alpha Chen <alpha.chen at gmail.com> wrote:> > On 6/27/07, Joshua Schairbaum <joshua.schairbaum at gmail.com> wrote: > > > > I can''t get fixtures to load correctly in a Mosquito test. The first > > fixture loads in the unit test, but the rest don''t load at all. > > > I actually ran into a similar problem, although none of my fixtures were > loaded at all. On running the example blog tests included with mosquito, > there were a number of failures which appeared related to to the non-loading > fixtures. > > I found that changing "change_fixtures" to "self.fixtures" on line 25 of > mosquito.rb solved the problem for me, though I don''t know enough about > Camping, Mosquito, and ActiveRecord to know if this is the best fix or not. > > Regards, > Alpha > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20070627/5c62c4e1/attachment-0001.html
I''d be interested in seeing your RSpec work. I''m working on an app ("Specter") that will display run the specs for any apps you''re running, and store the successes and failures in the db for historical purposes. I must say, writing specs for an app that runs specs is a little bit of a mind bender. :-) I''d be happy to help put the spit and polish on (figuratively). -M On 6/27/07, Geoffrey Grosenbach <boss at topfunky.com> wrote:> > On 6/27/07, Joshua Schairbaum <joshua.schairbaum at gmail.com> wrote: > > > I can''t get fixtures to load correctly in a Mosquito test. The first > > fixture loads in the unit test, but the rest don''t load at all. > > I haven''t touched Mosquito in a while. I''ve actually hacked out a > simple BDD library for Camping using RSpec, but haven''t polished it up > for release yet. > > -- > Geoffrey Grosenbach > ........................ > Screencast | http://peepcode.com > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On 6/27/07, Mark Fredrickson <mark.m.fredrickson at gmail.com> wrote:> I''d be interested in seeing your RSpec work. > > I''d be happy to help put the spit and polish on (figuratively).Here''s as far as I''ve gotten so far: http://svn.topfunky.com/public/camping/thief/spec/thief_spec.rb -- Geoffrey Grosenbach ........................ Screencast | http://peepcode.com