FlyingTable
Create and destroy tables on the fly. Quickly build up and teardown tables with class. Primarily for testing purposes.
Installation
Add this line to your application's Gemfile:
gem 'flying_table'
And then execute:
$ bundle
Or install it yourself as:
$ gem install flying_table
Usage
In your tests to create and destroy tables:
$ @tables = FlyingTable.create(example: {name: :string, created: :date})
And when complete:
$ @tables.teardown
To use with a block:
$ FlyingTable.with(example: {name: :string, created: :date}) do
$ # do stuff with Example
$ end
In your tests to create a table with class name Example fields name: :string and created: :date
$ FlyingTable.create(example: {name: :string, created: :date})
To create multiple tables:
$ FlyingTable.create(example: {name: :string}, example2: {created: :date})
To destroy tables
$ FlyingTable.destroy(:example,:example2)
Contributing
- Fork it ( https://github.com/[my-github-username]/flying_table/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Author
- Chris Moody
- Ian Snyder
License
This is free software released into the public domain.