• Save
Isolated Fixtures
Upcoming SlideShare
Loading in...5
×
 

Isolated Fixtures

on

  • 2,978 views

A brief overview of "isolated fixtures": a way to provide independent fixture sets for each Ruby on Rails Unit::TestCase.

A brief overview of "isolated fixtures": a way to provide independent fixture sets for each Ruby on Rails Unit::TestCase.

Statistics

Views

Total Views
2,978
Views on SlideShare
2,957
Embed Views
21

Actions

Likes
1
Downloads
0
Comments
0

3 Embeds 21

http://blog.spotstory.com 11
http://bitly.com 9
http://72.14.235.104 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Isolated Fixtures Isolated Fixtures Presentation Transcript

  • Isolated Fixtures Matthew Bellantoni [email_address] Boston Ruby Group March 13, 2007
  • What is it? Independent fixture sets for each unit and functional Unit::TestCase
  • Why do I care?
    • Now
    • Create fixtures without breaking tests
    • Create fixtures faster
    • Later
    • Fixtures are easier to understand
  • How do I install it? 1. Create test/test_helper/fixtures.rb 2. Include from test/test_helper.rb bp = File.dirname(__FILE__) fp = File.expand_path(bp + "/test_helper/fixtures") require fp
  • How do I use it? 1. Include in your test in place of fixtures require File.dirname(__FILE__) + '/../test_helper' class UserAnalyticsTest < Test::Unit::TestCase isolated_fixtures :users, :active_days def test_something ...
  • How do I use it? 2. Create fixtures for UserAnalyticsTest test/fixtures/user_analytics/users.yml test/fixtures/user_analytics/active_days.yml
  • Where can I get the code? http://blog.spotstory.com [email_address]
  • Notes & Issues
    • Only tested on Rails 1.1.6
    • Rails 1.2 may have solved this problem?
    • Sorta kinda violates DRY?
    • Unacceptably hacky?
  • Questions or comments?
  • Isolated Fixtures Matthew Bellantoni [email_address] Boston Ruby Group March 13, 2007