Project

summoner

0.0
No commit activity in last 3 years
No release in over 3 years
Simple Ruby Fixtures replacement like Factory Girl, and many others, but based on simplicity.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme
Summoner
========

Summoner is a really simple fixture replacemoent for Ruby.

How to install
--------------
gem install summoner


You can _prepare_ your _monsters_ like:

Summoner.prepare :monster do |c|
  c.type "Esper"
end

Then, you can _summon_ your _monsters_ like:

Summoner.summon :monster

Or, if you need to override default values:

Summoner.summon :monster do |c|
  c.type "Guardian"
end

Also, you can override options with a hash:

Summoner.summon(:monster, :type => "Avatar")

v0.1.2
======
From v0.1.2 on, you can also summon ActiveRecord instances directly from their classes without prepare them before, for example:

Monster.summon do |m|
  m.type = "Esper"
end

Note the difference between with the _prepare_ method, here you should use the *=* sign to assign values.


Rails
-----

1. Add config.gem "summoner" to the config/environments/test.rb or gem "summoner" to your Gemfile if you're using bundler
2. Define your _monsters_ on a file, e.g: spec/monsters.rb (you can call it as you please)
3. Require that file on your (test|spec)_helper.rb
4. Summon your _monsters_ on your tests/specs