SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    0 Post(s)
    0 Thread(s)

    Lightbulb P. Lenz's Ruby Book : rake test : units [FIXED]

    solution : in /test/fixtures/stories.yml
    I was having a bad indentation, now no more error.
    Thanks for reply !

    Hello ,

    I'm just starting using RoR for an internship.

    I'm following P. Lenz book and I have a strange error when I try to run test in units using rake.
    I have the same error that I'm describing in my post now for the functional test

    Page : 171 : first use of rake test:units

    my test who live in test/unit/story_test.rb

    Code Ruby:
    require File.dirname(__FILE__) + '/../test_helper'
    class StoryTest < Test::Unit::TestCase
      fixtures :stories
      def test_should_require_name
        s = Story.create(:name => nil)
        assert s.errors.on(:name)
       def test_should_require_lik
       s = Story.create(:link => nil)
       assert s.errors.on(:link)
       def test_should_create_story
       s = Story.create(:name => 'testtest', :link => 'linktest')
       assert s.valid?

    the log result after launching rake test:units (only for the first test, and the end of the error), run as root on server.
    in /shovell i run rake test:units
    (in /home/admin/shovell)
    /usr/bin/ruby -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader.rb" "test/unit/story_test.rb"
    Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader
    Finished in 0.14955 seconds.

    1) Error:
    Errno::ENOENT: No such file or directory - SitePoint Forums
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:432:in `readlines'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:432:in `read_fixture_file'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:386:in `initialize'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:326:in `new'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:326:in `read_fixture_files'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:321:in `each'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:321:in `read_fixture_files'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:320:in `each'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:320:in `read_fixture_files'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:281:in `initialize'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:251:in `new'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:251:in `create_fixtures'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:250:in `map'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:250:in `create_fixtures'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/base.rb:867:in `silence'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:248:in `create_fixtures'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:593:in `load_fixtures'
    /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.4/lib/active_record/fixtures.rb:538:in `setup'

    //////.... I skip the other errors log (same error as the first one) ..... //////

    3 tests, 0 assertions, 0 failures, 3 errors
    rake aborted!
    Command failed with status (1): [/usr/bin/ruby -Ilib:test "/usr/lib/ruby/ge...]

    See the second line of the error 1
    my first question is how can I have something about site point forum in my trace, I am just following the book I don't have write my self the file, I haven't copy any file from the website SitePoint.

    I'm running Fedora Core 7.
    [root@localhost shovell]# ruby --version
    ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-linux]
    [root@localhost shovell]# rake --version
    rake, version 0.7.3
    [root@localhost shovell]# mysql --version
    mysql Ver 14.12 Distrib 5.0.37, for redhat-linux-gnu (i686) using readline 5.0
    [root@localhost shovell]#

    I have search via google and in this forum and I havent find any related answer.
    Did somebody here have the same error log or can explain me what's happen ?


    Last edited by Jarrek; Nov 12, 2007 at 04:17. Reason: adding informations


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts