Jafry
This gem allows you to easily create JSON data fixtures from data schemes you can specify by yourself. The main purpose is to stub JSON received form wide range of JSON API's for testing. And if you use many API's or kind of difficult one you may want to have a tool for easy creation of tons of JSON data you have. And Jafry can helps you here. Just specify data scheme in json file and then you can change your data easly, wrap it namespaces, build lists, etc.
Installation
Add this line to your application's Gemfile:
gem 'jafry'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jafry
Versioning
Gem is under active development so version 0.2.0 has some breakable changes.
Usage
- Create file
data_scheme_name.json
. - Put json data in it.
- In your
spec_helper.rb
requirejafry
:require "jafry"
. - Call
Jafry.build('data_scheme_name')
to get object orJafry.create('data_scheme_name')
to get JSON in your spec.
Contributing
- Fork it ( https://github.com/[my-github-username]/jafry/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 on
dev
branch