Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 164 lines (102 sloc) 5.47 kb
cb57b2c @josevalim validates_format_of is deprecated [#76 status:resolved]
josevalim authored
1 = Remarkable
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
2
da81007 @josevalim Fixing link.
josevalim authored
3 You can read this file nicely formatted at the Rubyforge project page:
4
5 http://remarkable.rubyforge.org/
6
7 == Description
825eda9 @josevalim Added link on the top to rubyforge documentation.
josevalim authored
8
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
9 Remarkable is a framework for rspec matchers that supports macros and I18n. It's
10 constituted of three pieces:
11
4f7ef90 @josevalim Updated main README.
josevalim authored
12 * Remarkable: the framework with helpers, DSL, I18n and rspec features;
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
13
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
14 * Remarkable ActiveModel: a collection of matchers for ActiveModel compliant models. It
15 currently supports all ActiveModel validations. Future plan include testing for
16 ActiveModel API compliance and ActiveModel serialization.
17
4f7ef90 @josevalim Updated main README.
josevalim authored
18 * Remarkable ActiveRecord: a collection of matchers for ActiveRecord. It
19 supports all ActiveRecord validations, associations and some extra matchers.
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
20
4f7ef90 @josevalim Updated main README.
josevalim authored
21 * Remarkable Rails: a collection of matchers for ActionController. It also
22 includes MacroStubs, which is a clean DSL for stubbing your controller methods.
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
23
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
24 NOTE: Remarkable Rails is currently not available for version 4.0.0.alpha1
25 We are thinking of breaking this up into Remarkable Rack, and Remarkable ActionController
26 gems, along the lines of splitting off ActiveModel macros.
27
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
28 In each folder above, you can find a README more detailed description of each piece.
29
4f7ef90 @josevalim Updated main README.
josevalim authored
30 == Why use Remarkable for Rails?
31
32 * The only one with matchers for all ActiveRecord validations, with support to
7b73b62 @josevalim Updated documentation to reflect on the new options supported by associa...
josevalim authored
33 all options (except :on and the option :with in validates_format_of);
4f7ef90 @josevalim Updated main README.
josevalim authored
34
35 * Matchers for all ActiveRecord associations. The only one which supports all
36 these options:
37
7b73b62 @josevalim Updated documentation to reflect on the new options supported by associa...
josevalim authored
38 :through, :source, :source_type, :class_name, :foreign_key, :dependent,
39 :join_table, :uniq, :readonly, :validate, :autosave, :counter_cache, :polymorphic
40
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
41 Plus Arel scopes:
7b73b62 @josevalim Updated documentation to reflect on the new options supported by associa...
josevalim authored
42
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
43 :select, :where, :include, :group, :having, :order, :limit, :offset
4f7ef90 @josevalim Updated main README.
josevalim authored
44
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
45 Besides in Remarkable 4.0 matchers became much smarter. Whenever :join_table
4f7ef90 @josevalim Updated main README.
josevalim authored
46 or :through is given as option, it checks if the given table exists. Whenever
47 :foreign_key or :counter_cache is given, it checks if the given column exists;
48
49 * ActionController matchers:
50
51 :assign_to, :filter_params, :redirect_to, :render_with_layout, :respond_with,
52 :render_template, :route, :set_session and :set_the_flash;
53
54 * Macro stubs: make your controllers specs easier to main, more readable and DRY;
55
56 * Tests and more tests. We have a huge tests suite ready to run and tested in
57 Rails 2.1.2, 2.2.2 and 2.3.2;
58
59 * I18n and great documentation.
60
4b4ebd8 @josevalim Updated READMEs with outline of the new features to come.
josevalim authored
61 * It has your style. You can choose between:
62
63 1) it { should validate_numericality_of(:age).greater_than(18).only_integer }
64
65 2) it { should validate_numericality_of(:age, :greater_than => 18, :only_integer => true) }
66
67 3) should_validate_numericality_of :age, :greater_than => 18, :only_integer => true
68
69 4) should_validate_numericality_of :age do |m|
70 m.only_integer
71 m.greater_than 18
33a97b6 @josevalim Ensure that optionals that can accept procs also accepts blocks.
josevalim authored
72 # Or: m.greater_than = 18
4b4ebd8 @josevalim Updated READMEs with outline of the new features to come.
josevalim authored
73 end
74
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
75 Remarkable Rails requires rspec >= 2.0.0 and rspec-rails >= 2.0.0.
53590d9 @josevalim Added Remarkable ActiveRecord README.
josevalim authored
76
11544f3 @josevalim Updated READMEs.
josevalim authored
77 == Install on Rails
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
78
79 Install the gem:
80
81 sudo gem install remarkable_rails
82
83 This will install remarkable, remarkable_activerecord and remarkable_rails gems.
4f7ef90 @josevalim Updated main README.
josevalim authored
84
85 Inside Rails you need to require just this gem. If you are using ActiveRecord,
86 it will automatically require the remarkable_activerecord gem.
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
87
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
88 == Rails 3
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
89
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
90 In Rails 3, in order to rspec load properly, you have to use this configuration
91 on your Gemfile
11544f3 @josevalim Updated READMEs.
josevalim authored
92
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
93 gem "rspec"
94 gem "rspec-rails"
1ee8d21 @hosh [DOC] Added installation instructions using the simplified load mechanis...
hosh authored
95 gem "remarkable_activerecord"
11544f3 @josevalim Updated READMEs.
josevalim authored
96
1ee8d21 @hosh [DOC] Added installation instructions using the simplified load mechanis...
hosh authored
97 NOTE: remarkable_rails is currently not supported.
98
7625d4f @joaovitor Rspec changed to RSpec
joaovitor authored
99 Add the require after the rspec/rails line in your spec_helpers.rb. Although RSpec2 convention
1ee8d21 @hosh [DOC] Added installation instructions using the simplified load mechanis...
hosh authored
100 encourages you to use spec/support/, if you have Remarkable matchers in there, you will want
101 to load that after you load Remarkable
11544f3 @josevalim Updated READMEs.
josevalim authored
102
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
103 require 'rspec/rails'
1ee8d21 @hosh [DOC] Added installation instructions using the simplified load mechanis...
hosh authored
104 require 'remarkable/active_record'
105
106 Alternatively, if you are using an ActiveModel-compliant gem, such as the newer Mongo and
107 CouchDB gems, you can use:
108
109 require 'remarkable/active_model'
110
111 and have access to all ActiveModel matchers. Note that loading remarkable/active_record will
112 automatically load remarkable/active_model
11544f3 @josevalim Updated READMEs.
josevalim authored
113
114 This is the safest way to avoid conflicts.
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
115
7625d4f @joaovitor Rspec changed to RSpec
joaovitor authored
116 Please note, due to the massive refactoring in Rails 3 and RSpec 2, we are not supporting
117 backwards compatibility with Rails 2 or RSpec 1. You will need to use the Remarkable 3.x series
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
118 if you are still using Rails 2.
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
119
ac45b73 @joaovitor Instructions to setup developer machine on README
joaovitor authored
120 == How to setup your machine to contribute with remarkable?
121
122 gem install bundler
123 bundle install
124 rake # red, green, refactor
125
11544f3 @josevalim Updated READMEs.
josevalim authored
126 == Developers
127
128 If you are developing matchers, for example hpricot matchers, you need to install
129 only the remarkable "core" gem:
130
131 sudo gem install remarkable
53590d9 @josevalim Added Remarkable ActiveRecord README.
josevalim authored
132
11544f3 @josevalim Updated READMEs.
josevalim authored
133 If you stumble into any problem or have doubts while building your matchers,
134 please drop us a line. We are currently searching for people who wants to join
135 us and provide matchers for Datamapper, Sequel, Sinatra and all other possible
136 options. :)
53590d9 @josevalim Added Remarkable ActiveRecord README.
josevalim authored
137
c74c27d @josevalim Added browse the documentation to rubyforge.
josevalim authored
138 == Browse the documentation
139
140 Remarkable:
141 http://remarkable.rubyforge.org/core/
142
143 Remarkable ActiveRecord:
144 http://remarkable.rubyforge.org/activerecord/
145 http://remarkable.rubyforge.org/activerecord/classes/Remarkable/ActiveRecord/Matchers.html
146
147 Remarkable Rails:
148 http://remarkable.rubyforge.org/rails/
149 http://remarkable.rubyforge.org/rails/classes/Remarkable/ActionController/Matchers.html
150
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
151 == More information
152
153 Google group: http://groups.google.com/group/remarkable-core
8b4fbc9 @hosh [ARCH/DOC] Use Jeweler for building gems. Updated documentation.
hosh authored
154 Bug tracking: http://github.com/remarkable/remarkable/issues
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
155
5920a1a @hosh [DOC] Added contributors link
hosh authored
156 == Contributors
157
158 http://github.com/remarkable/remarkable/contributors
159
f42b256 @josevalim Worked a little bit on Remarkable core documentation.
josevalim authored
160 == LICENSE
161
162 All projects are under MIT LICENSE.
163
Something went wrong with that request. Please try again.