Skip to content

Instantly share code, notes, and snippets.

@hadronzoo
hadronzoo / test.rb
Created November 13, 2011 06:29
Simplified test case with associations fixed
require 'dm-core'
DataMapper.setup(:default, 'sqlite::memory:')
class Project
include DataMapper::Resource
property :id, Serial
has n, :members
has n, :users, :through => :members
% Run a Monty Hall problem simulation with the following parameters:
%
% changeDoors: boolean determining whether the contestant should change
% doors
%
% doors: the number of doors in the problem, with a minimum of 2
%
% N: the number of problem simulations to perform, with a minimum
% of 1
%