CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sun, 17 Aug 2025 22:04:11 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090116032354
location: https://web.archive.org/web/20090116032354/https://github.com/methodmissing/model_stubbing/tree
server-timing: captures_list;dur=0.656908, exclusion.robots;dur=0.024173, exclusion.robots.policy;dur=0.011140, esindex;dur=0.012750, cdx.remote;dur=6.093809, LoadShardBlock;dur=224.451447, PetaboxLoader3.datanode;dur=54.467291, PetaboxLoader3.resolve;dur=107.311500
x-app-server: wwwb-app222
x-ts: 302
x-tr: 257
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app222; 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: Sun, 17 Aug 2025 22:04:11 GMT
content-type: text/html; charset=utf-8
content-length: 124
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 16 Jan 2009 03:23:53 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090116032354/https://github.com/methodmissing/model_stubbing/tree/master
x-archive-orig-x-runtime: 130ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 124
cache-control: max-age=1800
memento-datetime: Fri, 16 Jan 2009 03:23:54 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 16 Jan 2009 03:23:54 GMT", ; rel="memento"; datetime="Fri, 16 Jan 2009 03:23:54 GMT", ; rel="next memento"; datetime="Wed, 18 Mar 2009 01:30:27 GMT", ; rel="last memento"; datetime="Wed, 18 Mar 2009 01:30:27 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_20090116011028_crawl104-c/52_7_20090116032212_crawl103.arc.gz
server-timing: captures_list;dur=0.723742, exclusion.robots;dur=0.028253, exclusion.robots.policy;dur=0.013174, esindex;dur=0.015648, cdx.remote;dur=40.873656, LoadShardBlock;dur=86.616503, PetaboxLoader3.datanode;dur=141.277980, load_resource;dur=181.646705, PetaboxLoader3.resolve;dur=104.431596
x-app-server: wwwb-app222
x-ts: 301
x-tr: 336
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
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: Sun, 17 Aug 2025 22:04:12 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 16 Jan 2009 03:23:54 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 273ms
x-archive-orig-etag: "75c104308a2dab01356532db53a3ebbf"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 17685
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 16 Jan 2009 03:23:54 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Fri, 16 Jan 2009 03:23:54 GMT", ; rel="memento"; datetime="Fri, 16 Jan 2009 03:23:54 GMT", ; rel="next memento"; datetime="Sat, 17 Jan 2009 05:06:48 GMT", ; rel="last memento"; datetime="Thu, 27 Aug 2009 14:47:57 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_20090116011028_crawl104-c/52_7_20090116032212_crawl103.arc.gz
server-timing: captures_list;dur=0.696884, exclusion.robots;dur=0.028571, exclusion.robots.policy;dur=0.012370, esindex;dur=0.018373, cdx.remote;dur=9.018285, LoadShardBlock;dur=173.571954, PetaboxLoader3.datanode;dur=77.000525, PetaboxLoader3.resolve;dur=313.582754, load_resource;dur=242.955100
x-app-server: wwwb-app222
x-ts: 200
x-tr: 493
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
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
methodmissing's model_stubbing at master - GitHub
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 technoweenie/model_stubbing | |
Description: | Replacement for ActiveRecord fixtures using an extremely flexible ruby-based approach. |
Clone URL: |
git://github.com/methodmissing/model_stubbing.git
Give this clone URL to anyone.
git clone git://github.com/methodmissing/model_stubbing.git
|
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Loading commit data... ![]() |
|
![]() |
LICENSE | Mon Oct 08 00:59:49 -0700 2007 | fixture_mocking: The lauching stock of the rail... [rick] |
![]() |
README | Tue Jun 17 01:21:43 -0700 2008 | Added example of handling many-to-many stub setup [lawrencepit] |
![]() |
lib/ | ||
![]() |
spec/ | ||
![]() |
tasks/ | Mon Aug 25 14:08:55 -0700 2008 | I don't think this is the time, nor the place [technoweenie] |
model_stubbing ============== Creates in-memory versions of models for testing. This attempts to solve a few problems with ActiveRecord Fixtures: Speed - There's no hit to the database and no cleanup between tests. Flexibility - You can define a global set of stubs, or define custom ones for specific tests/specs A lot of these ideas were taken from various approaches to fixtures and mocking that I've seen: fixture scenarios (https://errtheblog.com/post/7708) unit_record (https://www.dcmanges.com/blog/rails-unit-record-test-without-the-database) Rspec and #mock_model Exemplar (https://www.bofh.org.uk/articles/2007/08/05/doing-the-fixture-thing) I actually saw Exemplar after I wrote the initial version, but they do seem similar. I honestly don't know if this is a better way or anything, I'm just experimenting with a different approach. Oh, and apparently this is an implementation of the ObjectMother (https://www.martinfowler.com/bliki/ObjectMother.html) pattern? # test/unit example # test/unit support not fully implemented yet require 'model_stubbing' class FooTest < Test::Unit::TestCase define_models do time 2007, 6, 1 model Role do stub :owner, :name => 'owner' stub :author, :name => 'author' end model User do stub :name => 'bob', :admin => false stub :admin, :admin => true # inherits from default fixture stub :author, :roles => [all_stubs(:author_role)] stub :owner, :roles => [all_stubs(:author_role), all_stubs(:owner_role)] end model Post do # uses admin user fixture above stub :title => 'initial', :user => all_stubs(:admin_user), :published_at => current_time + 5.days end end def test_foo @user = users(:default) # default user stub @admin = users(:admin) @custom = users(:default, :age => 25) # custom attributes, #but not equal to @user any more @post = posts(:default) @post.user # equal to @admin above current_time # stubbed to be 6/1/2007 using mocha or rspec end end # rspec example require 'model_stubbing' describe Foo do ... end TODO ==== * Support other mocking frameworks besides rspec and mocha? * Support Sequel, DataMapper, etc? I use AR, but I'm willing to abstract some of that out in case someone wants to support another ORM.
This feature is coming soon. Sit tight!