Jafry

Build Status Gem Version Coverage Status Code Climate

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

  1. Create file data_scheme_name.json.
  2. Put json data in it.
  3. In your spec_helper.rb require jafry: require "jafry".
  4. Call Jafry.build('data_scheme_name') to get object or Jafry.create('data_scheme_name') to get JSON in your spec.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/jafry/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request on dev branch