github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

carlosbrando / remarkable

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 390
    • 29
  • Source
  • Commits
  • Network (29)
  • Issues (7)
  • Downloads (4)
  • Wiki (5)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • 2.3-stable
    • master ✓
  • Tags (4)
    • 2.3.1
    • 2.2.4
    • 2.1.7
    • 2.1.1
Sending Request…
Click here to lend your support to: remarkable and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Simplifying tests! — Read more

  cancel

http://www.nomedojogo.com/category/remarkable/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Ensure validate_presence_of matcher works with non AR classes. 
carlosantoniodasilva (author)
Thu Feb 04 10:47:22 -0800 2010
josevalim (committer)
Thu Feb 04 10:59:32 -0800 2010
commit  9b591f16b3043edaf753ad96d3ff1bc3a64cd773
tree    a2f3a221fb9e11c49fc7decb4cc8cdc63736c1b6
parent  3e37f949c282c925e1575e8eb8020d74140ca2ba
remarkable /
name age
history
message
file .gitignore Wed Jan 20 09:13:52 -0800 2010 Fixed extended example group behaviour when dec... [codebeige]
file LICENSE Thu Mar 26 03:09:11 -0700 2009 Updated license. [josevalim]
file README Mon Sep 21 14:14:06 -0700 2009 Change issues tracking from Lighthouse to Github. [josevalim]
file Rakefile Mon Jan 18 15:06:44 -0800 2010 Bump to 3.1.12 and release on gemcutter. [josevalim]
file rake_helpers.rb Mon Jan 18 15:00:31 -0800 2010 Updated #configure_gemspec! so that the gemspec... [Myron Marston]
directory remarkable/ Mon Jan 18 15:06:44 -0800 2010 Bump to 3.1.12 and release on gemcutter. [josevalim]
directory remarkable_activerecord/ Thu Feb 04 10:59:32 -0800 2010 Ensure validate_presence_of matcher works with ... [carlosantoniodasilva]
directory remarkable_datamapper/ Mon Jan 18 15:06:44 -0800 2010 Bump to 3.1.12 and release on gemcutter. [josevalim]
directory remarkable_i18n/ Tue Sep 01 19:13:57 -0700 2009 Able to get specs running without i18n enabled.... [bgentry]
directory remarkable_rails/ Wed Jan 20 09:13:52 -0800 2010 Fixed extended example group behaviour when dec... [codebeige]
README
= Remarkable

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.

* It has your style. You can choose between:

    1) it { should validate_numericality_of(:age).greater_than(18).only_integer }

    2) it { should validate_numericality_of(:age, :greater_than => 18, :only_integer => true) }

    3) should_validate_numericality_of :age, :greater_than => 18, :only_integer => true

    4) should_validate_numericality_of :age do |m|
         m.only_integer
         m.greater_than 18
         # Or: m.greater_than = 18
       end

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://github.com/carlosbrando/remarkable/issues

== LICENSE

All projects are under MIT LICENSE.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server