| Path: | README |
| Last Update: | Fri Apr 10 16:00:19 +0200 2009 |
Remarkable is a framework for rspec matchers that supports macros and I18n. It‘s constituted of three pieces:
In each folder above, you can find a README more detailed description of each piece.
:through, :class_name, :foreign_key, :dependent, :join_table, :uniq, :readonly, :validate, :autosave, :counter_cache, :polymorphic
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;
:assign_to, :filter_params, :redirect_to, :render_with_layout, :respond_with, :render_template, :route, :set_session and :set_the_flash;
it { should validate_numericality_of(:age, :greater_than => 18, :only_integer => true) }it { should validate_numericality_of(:age).greater_than(18).only_integer }should_validate_numericality_of :age, :greater_than => 18, :only_integer => true
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 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.
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.
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. :)
Google group: groups.google.com/group/remarkable-core Bug tracking: carlosbrando.lighthouseapp.com/projects/19775-remarkable/overview
All projects are under MIT LICENSE.