CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Thu, 24 Jul 2025 07:43:04 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090104054854
location: https://web.archive.org/web/20090104054854/https://github.com/github/fixture_scenarios_builder/tree
server-timing: captures_list;dur=1.235066, exclusion.robots;dur=0.030590, exclusion.robots.policy;dur=0.014769, esindex;dur=0.014631, cdx.remote;dur=108.199043, LoadShardBlock;dur=717.825223, PetaboxLoader3.datanode;dur=399.938775, PetaboxLoader3.resolve;dur=118.972877
x-app-server: wwwb-app221
x-ts: 302
x-tr: 992
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app221; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Thu, 24 Jul 2025 07:43:05 GMT
content-type: text/html; charset=utf-8
content-length: 128
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Sun, 04 Jan 2009 05:48:52 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7ByIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ADoOcmV0dXJuX3RvIh0vaW5ib3gvbmV3L2tlbm5ldGhrYWxtZXI%3D--0bf68eb57a4dd1f86ce05145956e2b410834ba9d; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090104054854/https://github.com/github/fixture_scenarios_builder/tree/master
x-archive-orig-x-runtime: 204ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 128
cache-control: max-age=1800
memento-datetime: Sun, 04 Jan 2009 05:48:54 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 26 Jul 2008 00:00:06 GMT", ; rel="prev memento"; datetime="Sat, 26 Jul 2008 00:00:06 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 05:48:54 GMT", ; rel="last memento"; datetime="Sun, 04 Jan 2009 05:48:54 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104054434_crawl103.arc.gz
server-timing: captures_list;dur=0.812717, exclusion.robots;dur=0.028403, exclusion.robots.policy;dur=0.014251, esindex;dur=0.017406, cdx.remote;dur=94.875783, LoadShardBlock;dur=668.803293, PetaboxLoader3.datanode;dur=246.361494, PetaboxLoader3.resolve;dur=621.504059, load_resource;dur=389.295349
x-app-server: wwwb-app221
x-ts: 301
x-tr: 1193
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Thu, 24 Jul 2025 07:43:06 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sun, 04 Jan 2009 05:48:53 GMT
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_ses=BAh7BzoOcmV0dXJuX3RvIh0vaW5ib3gvbmV3L2tlbm5ldGhrYWxtZXIiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%3D--51c1af4718904e2c62d0f5e1378c0cdc2bb9e55d; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT; HttpOnly
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 1711ms
x-archive-orig-etag: "0ece034ea1a62a1f30ce86659624594a"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 19857
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 04 Jan 2009 05:48:54 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sun, 04 Jan 2009 05:48:54 GMT", ; rel="memento"; datetime="Sun, 04 Jan 2009 05:48:54 GMT", ; rel="next memento"; datetime="Mon, 05 Jan 2009 08:14:56 GMT", ; rel="last memento"; datetime="Mon, 05 Jan 2009 08:14:56 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_7_20090104033323_crawl108-c/52_7_20090104054434_crawl103.arc.gz
server-timing: captures_list;dur=0.523413, exclusion.robots;dur=0.020009, exclusion.robots.policy;dur=0.009207, esindex;dur=0.010761, cdx.remote;dur=31.112392, LoadShardBlock;dur=412.398167, PetaboxLoader3.datanode;dur=226.521645, PetaboxLoader3.resolve;dur=209.180919, load_resource;dur=146.608256
x-app-server: wwwb-app221
x-ts: 200
x-tr: 650
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
github's fixture_scenarios_builder at master — GitHub
We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Fork of defunkt/fixture_scenarios_builder | |
Description: | Build your fixtures in Ruby. |
Homepage: | https://errtheblog.com/posts/61-fixin-fixtures |
Clone URL: |
git://github.com/github/fixture_scenarios_builder.git
Give this clone URL to anyone.
git clone git://github.com/github/fixture_scenarios_builder.git
|
name | age | message | |
---|---|---|---|
![]() |
LICENSE | Mon Jul 23 05:07:48 -0700 2007 | shuffle, fixture_scenarios_with_scenario_builde... [defunkt] |
![]() |
README | Thu Dec 27 14:40:32 -0800 2007 | fixture_scenarios_builder: custom names [Paul C... [defunkt] |
![]() |
init.rb | Mon Jul 23 05:07:48 -0700 2007 | shuffle, fixture_scenarios_with_scenario_builde... [defunkt] |
![]() |
install.rb | Mon Jul 23 05:07:48 -0700 2007 | shuffle, fixture_scenarios_with_scenario_builde... [defunkt] |
![]() |
lib/ | Tue Apr 22 09:40:00 -0700 2008 | Assume fixtures directory is spec/fixtures rath... [nick] |
![]() |
tasks/ | Tue Apr 22 10:33:36 -0700 2008 | Fix up rake task to use spec/fixtures over test... [nick] |
README
FixtureScenariosBuilder ======================= This plugin is an add-on to the FixtureScenarios plugin by Tom Preston-Werner. FixtureScenarios is required for this plugin to work. FixtureScenarios Info: https://code.google.com/p/fixture-scenarios/ SVN : https://fixture-scenarios.googlecode.com/svn/trunk/fixture_scenarios This plugin Info: https://errtheblog.com/post/7708 SVN : svn://errtheblog.com/svn/plugins/fixture_scenarios_builder Bugs: https://err.lighthouseapp.com/projects/466-plugins/tickets/new == The Setup You may, from time to time, wish to build your fixtures entirely in Ruby. Doing so has its advantages, such as automatically created join tables and default attributes. YAML files, however, bring with them some real nice features in Rails which are difficult to abandon: transactional fixtures, table_name(:key) helpers, and auto-clearing between tests. How does one get the best of both worlds? == The Download Using the +scenario+ method within <tt>scenarios.rb</tt> file, FixtureScenariosBuilder can create your YAML fixture scenarios automatically at run time from Ruby-created fixtures. Create a <tt>scenarios.rb</tt> file and place it in the root "fixtures" directory: [RAILS_ROOT] +-test/ +-fixtures/ +-scenarios.rb Now build your scenarios in this file, wrapping scenarios in the +scenario+ method and providing it with the name of your scenario. A brief example of a complete <tt>scenarios.rb</tt> file: scenario :banned_users do %w( Tom Chris Kevin ).each_with_index do |user, index| User.create(:name => user, :banned => index.odd?) end end Assuming +banned+ is a boolean field, this will create for us (when our tests are first run) the following: [RAILS_ROOT] +-test/ +-fixtures/ +-banned_users/ +-users.yml Our generated <tt>users.yml</tt> file will look something like this: chris: name: Chris id: "2" banned: "1" updated_at: 2007-05-09 09:08:04 created_at: 2007-05-09 09:08:04 kevin: name: Kevin id: "3" banned: "0" updated_at: 2007-05-09 09:08:04 created_at: 2007-05-09 09:08:04 tom: name: Tom id: "1" banned: "0" updated_at: 2007-05-09 09:08:04 created_at: 2007-05-09 09:08:04 Notice how the keys correspond to the user names. FixtureScenariosBuilder will try, to an extent, to guess the name of your key. If it can't figure it out, keys will be the standard user_001, user_002, etc format. Thanks to Paul Cantrell's handywork, custom key names are supported. Simply use the +name+ method: scenario :foo do name "small_red_widget", Widget.create(:size => 'small', :color => 'red') name "big_blue_widget", Widget.create(:size => 'big', :color => 'blue') end Another option is to assign your records to instance variables, then call +names_from_ivars+ at the conclusion of your +scenario+ block. scenario :foo do @small_red_widget = Widget.create(:size => 'small', :color => 'red') @big_blue_widget = Widget.create(:size => 'big', :color => 'blue') names_from_ivars! end The above produces the following YAML: small_red_widget: size: small color: red updated_at: 2007-12-27 10:09:05 created_at: 2007-12-27 10:09:05 big_blue_widget: size: big color: blue updated_at: 2007-12-27 10:19:23 created_at: 2007-12-27 10:19:23 On subsequent test runs this YAML file will not be needlessly re-created. YAML files will only be re-generated when the <tt>scenarios.rb</tt> file is modified. If you for some reason need to force your scenarios to rebuild, pass in the REBUILD_FIXTURES environment variables: $ rake test:units REBUILD_FIXTURES=true Scenarios can also be nested using the familiar Rake-style dependency declaration. scenario :users do %w( Tom Chris ).each do |user| User.create(:name => user) end end scenario :banned_users => :users do User.create(:name => 'Kevin', :banned => true) end == Rake FixtureScenariosBuilder comes with one Rake task, `db:scenario:build' -- use it to attempt to build your scenarios on demand. == Bugs! Please report bugs here: https://err.lighthouseapp.com/projects/466-plugins/tickets >> Chris Wanstrath => chris[at]ozmm[dot]org
This feature is coming soon. Sit tight!