No commit activity in last 3 years
No release in over 3 years
Dynamically generate Rails and Sinatra apps to be tested by Rack::Test.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0
>= 0
~> 1.0
~> 1.0
~> 0.0

Runtime

= 0.6.1
 Project Readme

FrameworkFixture

Dynamically generate Rails and Sinatra apps to be tested by Rack::Test.

Build Status

Why?

It is annoying to commit a bunch of Rails apps to my projects solely for the purpose of testing.

Seems more DRY to generate them when I run the test and automatically copy specific files into it.

Requirements

gem install framework_fixture

Add frameworks.yml to Fixtures Directory

rails:
  <3:
    rails2:
      - app/controllers/application_controller.rb
      - config/environment.rb
      - config/routes.rb
  <4:
    rails3:
      - app/controllers/application_controller.rb
      - config/application.rb
      - config/routes.rb
      - Gemfile
sinatra:
  <1:
    sinatra:
      - application.rb
  <2:
    sinatra:
      - application.rb

(See specs for example of what this configuration maps to)

Add to Test Helper

require 'rubygems'
require 'framework_fixture'

FrameworkFixture.generate(File.dirname(__FILE__) + '/fixtures')

Write Test

require 'spec_helper'

if FrameworkFixture.rails == '<4'
  describe 'Rails 3' do

    include Rack::Test::Methods

    def app
      FrameworkFixture.app.call
    end

    it "should have a pulse" do
      get "/pulse"
      last_response.body.should == '1'
    end
  end
end

Run Tests With Framework Environment Variable

RAILS_ENV=test RAILS=3 spec spec
SINATRA=1 spec spec