Sha256: ba6cf3b869c2162dae17bf30f32e3422325d376022f2e6580119f1a13153bd9a

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

# FigNewton

[![Build Status](http://travis-ci.org/cheezy/fig_newton.png)](http://travis-ci.org/cheezy/fig_newton)

Manages configuration for test suites.  It is common to need different configuration information for different test environments.  For example, the base_url or database login information might change when you move from development to a test environment.  FigNewton makes it simple to create and use this information.

## Usage

Using FigNewton is as simple as specifying the directory to use, loading a file from that directory, and then calling methods on the module that match the keys in the file.  Let's look at an example.

By default the FigNewton gem will look for files in the 'config/environments' directory.  Let's assume that we have files named ci.yml, test.yml, and system_test.yml in that directory.  All we need to do is call the `load` method in order to begin using a file:

````ruby
FigNewton.load('system_test.yml')
````

Next we simply begin calling methods on the FigNewton module that match our keys.  Let's assume the system_test.yml file contains the following entries:

base_url:  http://system_test.mycompany.com
database_user: cheezy
database_password: secret

In our code we can call methods that match the keys.  Here is an example PageObject where we are using the `base_url` entry:

````ruby
class MyPage
  include PageObject
  
  page_url "#{FigNewton.base_url}/my_page.html"
end
````



## Installation

Add this line to your application's Gemfile:

    gem 'fig_newton'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install fig_newton

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fig_newton-0.2 README.md