INSTALLATION
echo "gem 'machinist_blueprint_with_method',\
git: 'git://gist.github.com/6204150.git',\
group: 'test'" >> Gemfile
EXAMPLE OF USAGE
./spec/fixtures/blueprints.rb
Upload.blueprint do
index 0
relative_path "/"
bytes 100.bytes
asset { {} }
##
# Can declare a method for the object created with this blueprint
#
with_method(:upload_complete!) { update_attribute :remaining_bytes, 0 }
end
./spec/upload_spec.rb
let(:complete_upload) { Upload.make(user: peter.id, remaining_bytes: 100.bytes).upload_complete! }