[rails] attaching the debugger to functional test.

Discussion in 'Ruby' started by Dan Bikle, Oct 30, 2005.

  1. Dan Bikle

    Dan Bikle Guest

    People,

    I'm trying to run the ruby debugger against a Test::Unit::TestCase class
    which is a parent of a Rails class.

    I started my study with a simple script:

    #
    # bikle_test.rb
    #
    require 'test/unit'

    class BikleTest < Test::Unit::TestCase
    def setup
    @string10 =3D "hello"
    end
    def test10
    assert_equal @string10, "hello"
    end
    end


    The following command line works great:

    ruby -r debug bikle_test.rb


    Next, I create a new rails application with this command line:

    rails rtest

    Then, I create a database.yml:

    test:
    adapter: sqlite3
    dbfile: db/rtest.db

    Then I copied bikle_test.rb to...

    rtest/test/functional/

    I altered it a bit so it behaves like a typical Rails test:


    #
    # bikle_test.rb
    #
    require File.dirname(__FILE__) + '/../test_helper'

    class BikleTest < Test::Unit::TestCase
    def setup
    @string10 =3D "hello"
    end
    def test10
    assert_equal @string10, "hello"
    end
    end


    When I run it, I see this:

    zmac11:/cd/railsdemos/rtest/test/functional oracle$
    zmac11:/cd/railsdemos/rtest/test/functional oracle$
    zmac11:/cd/railsdemos/rtest/test/functional oracle$
    zmac11:/cd/railsdemos/rtest/test/functional oracle$
    zmac11:/cd/railsdemos/rtest/test/functional oracle$ ls
    /=09=09../=09=09bikle_test.rb
    zmac11:/cd/railsdemos/rtest/test/functional oracle$ ruby b*
    Loaded suite bikle_test
    Started
     
    Dan Bikle, Oct 30, 2005
    #1
    1. Advertisements

  2. Dan Bikle

    Eric Hodel Guest

    For Rails questions you'll get the best and fastest answers from the
    Rails mailing list:

    http://lists.rubyonrails.org/mailman/listinfo/rails
     
    Eric Hodel, Oct 30, 2005
    #2
    1. Advertisements

  3. Dan Bikle

    Dan Bikle Guest

    People,

    I got a good tip from the yahoo ba-rb group on this subject.

    The tip is to...
    'Ignore the error and just press c to continue'

    the tip worked for me.

    -Dan


     
    Dan Bikle, Nov 14, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.