Your SlideShare is downloading. ×
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? <ul><li>Now </li></ul><ul><li>Create fixtures without breaking tests </li></ul><ul><li>Create fixtures fast...
How do I install it? 1.  Create  test/test_helper/fixtures.rb 2.  Include from  test/test_helper.rb bp = File.dirname(__FI...
How do I use it? 1.  Include in your test in place of  fixtures require File.dirname(__FILE__) + '/../test_helper' class U...
How do I use it? 2.  Create fixtures for  UserAnalyticsTest test/fixtures/user_analytics/users.yml test/fixtures/user_anal...
Where can I get the code? http://blog.spotstory.com [email_address]
Notes & Issues <ul><li>Only tested on Rails 1.1.6 </li></ul><ul><li>Rails 1.2 may have solved this problem? </li></ul><ul>...
Questions or comments?
Isolated Fixtures Matthew Bellantoni [email_address] Boston Ruby Group March 13, 2007
Upcoming SlideShare
Loading in...5
×

Isolated Fixtures

1,382

Published on

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

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,382
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Isolated Fixtures"

  1. 1. Isolated Fixtures Matthew Bellantoni [email_address] Boston Ruby Group March 13, 2007
  2. 2. What is it? Independent fixture sets for each unit and functional Unit::TestCase
  3. 3. Why do I care? <ul><li>Now </li></ul><ul><li>Create fixtures without breaking tests </li></ul><ul><li>Create fixtures faster </li></ul><ul><li>Later </li></ul><ul><li>Fixtures are easier to understand </li></ul>
  4. 4. 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 + &quot;/test_helper/fixtures&quot;) require fp
  5. 5. 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 ...
  6. 6. How do I use it? 2. Create fixtures for UserAnalyticsTest test/fixtures/user_analytics/users.yml test/fixtures/user_analytics/active_days.yml
  7. 7. Where can I get the code? http://blog.spotstory.com [email_address]
  8. 8. Notes & Issues <ul><li>Only tested on Rails 1.1.6 </li></ul><ul><li>Rails 1.2 may have solved this problem? </li></ul><ul><li>Sorta kinda violates DRY? </li></ul><ul><li>Unacceptably hacky? </li></ul>
  9. 9. Questions or comments?
  10. 10. Isolated Fixtures Matthew Bellantoni [email_address] Boston Ruby Group March 13, 2007

×