GithubHelp home page GithubHelp logo

sneakin / remarkable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from remarkable-rb/remarkable

3.0 4.0 1.0 1.51 MB

Simplifying tests!

Home Page: http://www.nomedojogo.com/2008/11/18/shoulda-for-rspec-is-remarkable/

License: MIT License

Ruby 100.00%

remarkable's Introduction

= Remarkable 3.0

You can read this file nicely formatted at the Rubyforge project page:

  http://remarkable.rubyforge.org/

== Description

Remarkable is a framework for rspec matchers that supports macros and I18n. It's
constituted of three pieces:

* Remarkable: the framework with helpers, DSL, I18n and rspec features;

* Remarkable ActiveRecord: a collection of matchers for ActiveRecord. It
  supports all ActiveRecord validations, associations and some extra matchers.

* Remarkable Rails: a collection of matchers for ActionController. It also
  includes MacroStubs, which is a clean DSL for stubbing your controller methods.

In each folder above, you can find a README more detailed description of each piece.

== Why use Remarkable for Rails?

* The only one with matchers for all ActiveRecord validations, with support to
  all options (except :on and the option :with in validates_format_of);

* Matchers for all ActiveRecord associations. The only one which supports all
  these options:

    :through, :source, :source_type, :class_name, :foreign_key, :dependent,
    :join_table, :uniq, :readonly, :validate, :autosave, :counter_cache, :polymorphic

  Plus SQL options:

    :select, :conditions, :include, :group, :having, :order, :limit, :offset

  Besides in Remarkable 3.0 matchers became much smarter. Whenever :join_table
  or :through is given as option, it checks if the given table exists. Whenever
  :foreign_key or :counter_cache is given, it checks if the given column exists;

* ActionController matchers:

    :assign_to, :filter_params, :redirect_to, :render_with_layout, :respond_with, 
    :render_template, :route, :set_session and :set_the_flash;

* Macro stubs: make your controllers specs easier to main, more readable and DRY;

* Tests and more tests. We have a huge tests suite ready to run and tested in
  Rails 2.1.2, 2.2.2 and 2.3.2;

* I18n and great documentation.

Remarkable Rails requires rspec >= 1.2.0 and rspec-rails >= 1.2.0.

== Install on Rails

Install the gem:

  sudo gem install remarkable_rails

This will install remarkable, remarkable_activerecord and remarkable_rails gems.

Inside Rails you need to require just this gem. If you are using ActiveRecord,
it will automatically require the remarkable_activerecord gem.

== Rails 2.3

In Rails 2.3, in order to rspec load properly, you have to use this configuration
on your config/environments/test.rb

  config.gem "rspec",            :lib => false
  config.gem "rspec-rails",      :lib => false
  config.gem "remarkable_rails", :lib => false

And then require remarkable inside your spec_helper.rb, after "spec/rails":

  require 'spec/rails'
  require 'remarkable_rails'

This is the safest way to avoid conflicts.

Users who are upgrading to Remarkable 3.0, should not find any problem if their
tests are running without deprecation warnings.

== Developers

If you are developing matchers, for example hpricot matchers, you need to install
only the remarkable "core" gem:

  sudo gem install remarkable

If you stumble into any problem or have doubts while building your matchers,
please drop us a line. We are currently searching for people who wants to join
us and provide matchers for Datamapper, Sequel, Sinatra and all other possible
options. :)

== Browse the documentation

Remarkable:
  http://remarkable.rubyforge.org/core/

Remarkable ActiveRecord:
  http://remarkable.rubyforge.org/activerecord/
  http://remarkable.rubyforge.org/activerecord/classes/Remarkable/ActiveRecord/Matchers.html

Remarkable Rails:
  http://remarkable.rubyforge.org/rails/
  http://remarkable.rubyforge.org/rails/classes/Remarkable/ActionController/Matchers.html

== More information

Google group: http://groups.google.com/group/remarkable-core
Bug tracking: http://carlosbrando.lighthouseapp.com/projects/19775-remarkable/overview

== LICENSE

All projects are under MIT LICENSE.

remarkable's People

Contributors

andersondias avatar carlosbrando avatar chrislloyd avatar dcrec1 avatar jonathantron avatar josevalim avatar jqr avatar sneakin avatar szimek avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gardengeek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.