SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Simply Rails 2" > "Chapter 6 / Helpers, Forms..." > ... "Analyzing The Skeleton File

    As my default test/unit/story_test.rb, apparently I should see:
    require File.dirname(__FILE__) + '/../test_helper'
    class StoryTest < ActiveSupport::TestCase
    # Replace this with your real tests.
    def test_truth
    assert true
    end
    end
    I actually see:
    require 'test_helper'
    class StoryTest < ActiveSupport::TestCase

    # Replace this with your real tests.
    test "the truth" do
    assert true
    end
    end
    I'm wondering if this is because I'm using a slightly newer version of Ruby On Rails than the one used to write the book? Or my environment is configured slightly differently?

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. The format you have now is that which is created when you create a model and associated tests via the standard generator that ships with Rails 2.2.2. The book used an earlier version of Rails in which the generator created unit test based on a different template.

    The older variant will still work. They are different ways of doing the same thing.


Tags for this Thread

Bookmarks

Posting Permissions

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