elabs_matchers 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/Gemfile.lock +38 -34
  2. data/README.md +103 -0
  3. data/doc/Cucumber.html +116 -0
  4. data/doc/ElabsMatchers/Cucumber/Common.html +145 -0
  5. data/doc/ElabsMatchers/Cucumber.html +108 -0
  6. data/doc/ElabsMatchers/Helpers/Capybara.html +241 -0
  7. data/doc/ElabsMatchers/Helpers/Common.html +213 -0
  8. data/doc/ElabsMatchers/Helpers/Fixtures.html +201 -0
  9. data/doc/ElabsMatchers/Helpers/Orm.html +289 -0
  10. data/doc/ElabsMatchers/Helpers/Session.html +497 -0
  11. data/doc/ElabsMatchers/Helpers.html +110 -0
  12. data/doc/ElabsMatchers/Matchers/Capybara/Common.html +1159 -0
  13. data/doc/ElabsMatchers/Matchers/Capybara.html +38 -11
  14. data/doc/ElabsMatchers/Matchers/Rspec/Allow.html +98 -0
  15. data/doc/ElabsMatchers/Matchers/Rspec/Common.html +332 -0
  16. data/doc/ElabsMatchers/Matchers/Rspec/Orm.html +231 -0
  17. data/doc/ElabsMatchers/Matchers/Rspec.html +41 -12
  18. data/doc/ElabsMatchers/Matchers.html +30 -13
  19. data/doc/ElabsMatchers/Orm/Post.html +1041 -0
  20. data/doc/ElabsMatchers/Orm.html +108 -0
  21. data/doc/ElabsMatchers.html +31 -15
  22. data/doc/_index.html +179 -12
  23. data/doc/class_list.html +21 -10
  24. data/doc/css/full_list.css +2 -0
  25. data/doc/css/style.css +19 -15
  26. data/doc/file.README.html +129 -48
  27. data/doc/file_list.html +20 -9
  28. data/doc/frames.html +1 -1
  29. data/doc/index.html +129 -48
  30. data/doc/js/app.js +20 -18
  31. data/doc/js/full_list.js +36 -12
  32. data/doc/js/jquery.js +3 -3
  33. data/doc/method_list.html +308 -9
  34. data/doc/top-level-namespace.html +115 -12
  35. data/elabs_matchers.gemspec +3 -1
  36. data/lib/elabs_matchers/cucumber/common.rb +2 -4
  37. data/lib/elabs_matchers/helpers/common.rb +3 -1
  38. data/lib/elabs_matchers/helpers/session.rb +61 -6
  39. data/lib/elabs_matchers/matchers/capybara/common.rb +58 -13
  40. data/lib/elabs_matchers/matchers/rspec/allow.rb +112 -0
  41. data/lib/elabs_matchers/orm/post.rb +18 -3
  42. data/lib/elabs_matchers/version.rb +1 -1
  43. data/spec/elabs_matchers/helpers/session_spec.rb +35 -0
  44. data/spec/elabs_matchers/matchers/capybara/common_spec.rb +1 -1
  45. data/spec/elabs_matchers/matchers/rspec/allow_spec.rb +80 -0
  46. data/spec/elabs_matchers/matchers/rspec/orm_spec.rb +3 -3
  47. data/spec/spec_helper.rb +10 -1
  48. metadata +109 -101
  49. data/.rvmrc +0 -1
  50. data/README.rdoc +0 -45
data/doc/file.README.html CHANGED
@@ -2,17 +2,27 @@
2
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Documentation by YARD 0.6.5</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.7.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
16
 
10
17
  <script type="text/javascript" charset="utf-8">
11
18
  relpath = '';
12
19
  if (relpath != '') relpath += '/';
13
20
  </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
16
26
 
17
27
  </head>
18
28
  <body>
@@ -31,71 +41,142 @@
31
41
  </div>
32
42
 
33
43
  <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
44
+
45
+ <a id="class_list_link" href="#">Class List</a>
46
+
47
+ <a id="method_list_link" href="#">Method List</a>
48
+
49
+ <a id="file_list_link" href="#">File List</a>
50
+
37
51
  </div>
38
-
39
52
  <div class="clear"></div>
40
53
  </div>
41
54
 
42
55
  <iframe id="search_frame"></iframe>
43
56
 
44
57
  <div id="content"><div id='filecontents'><h1>Elabs matchers</h1>
45
- <p>
46
- A collection of useful rspec matchers
47
- </p>
48
- <h2>Installation</h2>
49
- <p>
50
- Install the gem with bundler:
51
- </p>
52
- <pre class="code">
53
- <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='bundler identifier id'>bundler</span>
54
- </pre>
55
- <p>
56
- add gem &#8216;elabs_matchers&#8217; to your Gemfile
57
- </p>
58
- <pre class="code">
59
- <span class='bundle identifier id'>bundle</span> <span class='install identifier id'>install</span>
60
- </pre>
58
+
59
+ <p><a href="http://travis-ci.org/elabs/elabs_matchers"><img src="https://secure.travis-ci.org/elabs/elabs_matchers.png" alt="Build Status"></a></p>
60
+
61
+ <p>Elabs matchers aims to extend existing rspec matchers from e.g Rspec, Rspec-rails and Capybara with a set
62
+ of less generic once. This could be things like asserting a table appearing in a certain way or check that
63
+ an active record instance has been successfully persisted after an update.</p>
64
+
65
+ <p>Below follows a list of matchers that the gem bundles. To get documentation about each matcher the source code is
66
+ your bast friend at this point.</p>
67
+
68
+ <h3>Model matchers:</h3>
69
+
70
+ <ul>
71
+ <li>hash.contain_hash({ &quot;baz&quot; =&gt; &quot;bar&quot; })</li>
72
+ <li>array.only_include(&quot;bar&quot;, &quot;foo&quot;)</li>
73
+ <li>record.should persist(:title, &quot;Blog post&quot;)</li>
74
+ <li>record.should allow(&quot;Blog post&quot;).as(:title)</li>
75
+ </ul>
76
+
77
+ <h3>Model helpers:</h3>
78
+
79
+ <ul>
80
+ <li>reload(post)</li>
81
+ <li>save_and_reload(post)</li>
82
+ </ul>
83
+
84
+ <h3>Acceptance matchers:</h3>
85
+
86
+ <ul>
87
+ <li>page.should have_options([&quot;Yes&quot;, &quot;No&quot;])</li>
88
+ <li>page.should have_table_row(&#39;Posts&#39;, &quot;Title&quot; =&gt; &quot;First&quot;, :year =&gt; &quot;2012&quot;)</li>
89
+ <li>page.should have_attribute(&quot;Status&quot;, &quot;Pending&quot;)</li>
90
+ <li>page.should have_image(&quot;Logo&quot;)</li>
91
+ <li>page.should have_header(&quot;Elabs&quot;)</li>
92
+ <li>page.should have_flash_notice(&quot;Success&quot;)</li>
93
+ <li>page.should have_flash_alert(&quot;Error&quot;)</li>
94
+ <li>page.should have_form_errors_on(&quot;Name&quot;, &quot;Can&#39;t be blank&quot;)</li>
95
+ <li>page.should have_fields(&quot;Author&quot; =&gt; &quot;Adam&quot;, &quot;Year&quot; =&gt; &quot;2011&quot;)</li>
96
+ </ul>
97
+
98
+ <h3>Acceptance helpers:</h3>
99
+
100
+ <ul>
101
+ <li>select_year_and_month(&quot;2010&quot;, &quot;March&quot;, :from =&gt; &quot;Birth date&quot;)</li>
102
+ <li>sign_in_as(user)</li>
103
+ <li>sign_out</li>
104
+ </ul>
105
+
106
+ <h3>Common helpers:</h3>
107
+
108
+ <ul>
109
+ <li>select_year_and_month(&quot;2010&quot;, &quot;March&quot;, :from =&gt; &quot;Birth date&quot;)</li>
110
+ <li>normalize_keys({ &quot;First name&quot; =&gt; &quot;Adam&quot; })</li>
111
+ <li>fixture_file(&quot;file.txt&quot;)</li>
112
+ </ul>
113
+
114
+ <h2>Setup</h2>
115
+
116
+ <p>add elabs_matchers to your Gemfile:</p>
117
+
118
+ <pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span>
119
+ </code></pre>
120
+
121
+ <p>if you&#39;re using Spork gem you need to tell bundler not to require the files for you:</p>
122
+
123
+ <pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:require</span> <span class='op'>=&gt;</span> <span class='kw'>false</span>
124
+ </code></pre>
125
+
126
+ <p>then you&#39;ll require them inside your spork prefork block:</p>
127
+
128
+ <pre class="code ruby"><code>Spork.prefork do
129
+ ...
130
+ require 'elabs_matchers'
131
+ ...
132
+ end
133
+ </code></pre>
134
+
135
+ <h2>Development</h2>
136
+
137
+ <pre class="code bash"><code>bundle exec rake
138
+ </code></pre>
139
+
140
+ <p>should run all the gem&#39;s specs.</p>
141
+
61
142
  <h2>TODOS</h2>
62
- <pre class="code">
63
- <span class='mult op'>*</span> <span class='Make constant id'>Make</span> <span class='yard identifier id'>yard</span> <span class='document identifier id'>document</span> <span class='rspec identifier id'>rspec</span> <span class='matchers identifier id'>matchers</span>
64
- <span class='mult op'>*</span> <span class='Use constant id'>Use</span> <span class='matcher identifier id'>matcher</span> <span class='with identifier id'>with</span> <span class='RSpec constant id'>RSpec</span><span class='colon2 op'>::</span><span class='Matchers constant id'>Matchers</span><span class='symbol val'>:DSL</span>
65
- <span class='mult op'>*</span> <span class='Remove constant id'>Remove</span> <span class='Rspec constant id'>Rspec</span> <span class='warning identifier id'>warning</span>
66
- <span class='mult op'>*</span> <span class='Add constant id'>Add</span> <span class='contributors identifier id'>contributors</span>
67
- </pre>
143
+
144
+ <ul>
145
+ <li>Make yard document rspec matchers</li>
146
+ <li>Use matcher with RSpec::Matchers:DSL</li>
147
+ <li>Add contributors</li>
148
+ </ul>
149
+
68
150
  <h2>License:</h2>
69
- <pre class="code">
70
- <span class='lparen token'>(</span><span class='The constant id'>The</span> <span class='MIT constant id'>MIT</span> <span class='License constant id'>License</span><span class='rparen token'>)</span>
71
151
 
72
- <span class='Copyright constant id'>Copyright</span> <span class='lparen token'>(</span><span class='c identifier id'>c</span><span class='rparen token'>)</span> <span class='integer val'>2011</span> <span class='Elabs constant id'>Elabs</span> <span class='AB constant id'>AB</span>
152
+ <p>(The MIT License)</p>
153
+
154
+ <p>Copyright (c) 2012 Elabs AB</p>
73
155
 
74
- <span class='Permission constant id'>Permission</span> <span class='is identifier id'>is</span> <span class='hereby identifier id'>hereby</span> <span class='granted identifier id'>granted</span><span class='comma token'>,</span> <span class='free identifier id'>free</span> <span class='of identifier id'>of</span> <span class='charge identifier id'>charge</span><span class='comma token'>,</span> <span class='to identifier id'>to</span> <span class='any identifier id'>any</span> <span class='person identifier id'>person</span> <span class='obtaining identifier id'>obtaining</span>
75
- <span class='a identifier id'>a</span> <span class='copy identifier id'>copy</span> <span class='of identifier id'>of</span> <span class='this identifier id'>this</span> <span class='software identifier id'>software</span> <span class='and and kw'>and</span> <span class='associated identifier id'>associated</span> <span class='documentation identifier id'>documentation</span> <span class='files identifier id'>files</span> <span class='lparen token'>(</span><span class='the identifier id'>the</span>
76
- <span class='string val'>'Software'</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='to identifier id'>to</span> <span class='deal identifier id'>deal</span> <span class='in in kw'>in</span> <span class='the identifier id'>the</span> <span class='Software constant id'>Software</span> <span class='without identifier id'>without</span> <span class='restriction identifier id'>restriction</span><span class='comma token'>,</span> <span class='including identifier id'>including</span>
77
- <span class='without identifier id'>without</span> <span class='limitation identifier id'>limitation</span> <span class='the identifier id'>the</span> <span class='rights identifier id'>rights</span> <span class='to identifier id'>to</span> <span class='use identifier id'>use</span><span class='comma token'>,</span> <span class='copy identifier id'>copy</span><span class='comma token'>,</span> <span class='modify identifier id'>modify</span><span class='comma token'>,</span> <span class='merge identifier id'>merge</span><span class='comma token'>,</span> <span class='publish identifier id'>publish</span><span class='comma token'>,</span>
78
- <span class='distribute identifier id'>distribute</span><span class='comma token'>,</span> <span class='sublicense identifier id'>sublicense</span><span class='comma token'>,</span> <span class='and and kw'>and</span><span class='regexp val'>/or sell copies of the Software, and to
156
+ <p>Permission is hereby granted, free of charge, to any person obtaining
157
+ a copy of this software and associated documentation files (the
158
+ &#39;Software&#39;), to deal in the Software without restriction, including
159
+ without limitation the rights to use, copy, modify, merge, publish,
160
+ distribute, sublicense, and/or sell copies of the Software, and to
79
161
  permit persons to whom the Software is furnished to do so, subject to
80
- the following conditions:
162
+ the following conditions:</p>
81
163
 
82
- The above copyright notice and this permission notice shall be
83
- included in all copies or substantial portions of the Software.
164
+ <p>The above copyright notice and this permission notice shall be
165
+ included in all copies or substantial portions of the Software.</p>
84
166
 
85
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
167
+ <p>THE SOFTWARE IS PROVIDED &#39;AS IS&#39;, WITHOUT WARRANTY OF ANY KIND,
86
168
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
87
169
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
88
170
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
89
171
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90
172
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
92
- </span></pre>
173
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
93
174
  </div></div>
94
175
 
95
176
  <div id="footer">
96
- Generated on Wed Jun 15 10:20:45 2011 by
177
+ Generated on Fri Feb 17 16:29:16 2012 by
97
178
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
98
- 0.6.5 (ruby-1.8.7).
179
+ 0.7.5 (ruby-1.9.3).
99
180
  </div>
100
181
 
101
182
  </body>
data/doc/file_list.html CHANGED
@@ -2,11 +2,19 @@
2
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
  <html>
4
4
  <head>
5
- <meta name="Content-Type" content="text/html; charset=utf-8" />
6
- <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
- <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
10
18
  <base id="base_target" target="_parent" />
11
19
  </head>
12
20
  <body>
@@ -19,9 +27,13 @@
19
27
  <div id="content">
20
28
  <h1 id="full_list_header">File List</h1>
21
29
  <div id="nav">
22
- <a target="_self" href="class_list.html">Classes</a> |
23
- <a target="_self" href="method_list.html">Methods</a> |
24
- <a target="_self" href="file_list.html">Files</a>
30
+
31
+ <a target="_self" href="class_list.html">Classes</a>
32
+
33
+ <a target="_self" href="method_list.html">Methods</a>
34
+
35
+ <a target="_self" href="file_list.html">Files</a>
36
+
25
37
  </div>
26
38
  <div id="search">Search: <input type="text" /></div>
27
39
 
@@ -35,4 +47,3 @@
35
47
  </div>
36
48
  </body>
37
49
  </html>
38
-
data/doc/frames.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
- <title>Documentation by YARD 0.6.5</title>
7
+ <title>Documentation by YARD 0.7.5</title>
8
8
  </head>
9
9
  <frameset cols="20%,*">
10
10
  <frame name="list" src="class_list.html" />
data/doc/index.html CHANGED
@@ -2,17 +2,27 @@
2
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <title>Documentation by YARD 0.6.5</title>
7
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.7.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
16
 
10
17
  <script type="text/javascript" charset="utf-8">
11
18
  relpath = '';
12
19
  if (relpath != '') relpath += '/';
13
20
  </script>
14
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
16
26
 
17
27
  </head>
18
28
  <body>
@@ -31,71 +41,142 @@
31
41
  </div>
32
42
 
33
43
  <div id="search">
34
- <a id="class_list_link" href="#">Class List</a>
35
- <a id="method_list_link" href="#">Method List</a>
36
- <a id ="file_list_link" href="#">File List</a>
44
+
45
+ <a id="class_list_link" href="#">Class List</a>
46
+
47
+ <a id="method_list_link" href="#">Method List</a>
48
+
49
+ <a id="file_list_link" href="#">File List</a>
50
+
37
51
  </div>
38
-
39
52
  <div class="clear"></div>
40
53
  </div>
41
54
 
42
55
  <iframe id="search_frame"></iframe>
43
56
 
44
57
  <div id="content"><div id='filecontents'><h1>Elabs matchers</h1>
45
- <p>
46
- A collection of useful rspec matchers
47
- </p>
48
- <h2>Installation</h2>
49
- <p>
50
- Install the gem with bundler:
51
- </p>
52
- <pre class="code">
53
- <span class='gem identifier id'>gem</span> <span class='install identifier id'>install</span> <span class='bundler identifier id'>bundler</span>
54
- </pre>
55
- <p>
56
- add gem &#8216;elabs_matchers&#8217; to your Gemfile
57
- </p>
58
- <pre class="code">
59
- <span class='bundle identifier id'>bundle</span> <span class='install identifier id'>install</span>
60
- </pre>
58
+
59
+ <p><a href="http://travis-ci.org/elabs/elabs_matchers"><img src="https://secure.travis-ci.org/elabs/elabs_matchers.png" alt="Build Status"></a></p>
60
+
61
+ <p>Elabs matchers aims to extend existing rspec matchers from e.g Rspec, Rspec-rails and Capybara with a set
62
+ of less generic once. This could be things like asserting a table appearing in a certain way or check that
63
+ an active record instance has been successfully persisted after an update.</p>
64
+
65
+ <p>Below follows a list of matchers that the gem bundles. To get documentation about each matcher the source code is
66
+ your bast friend at this point.</p>
67
+
68
+ <h3>Model matchers:</h3>
69
+
70
+ <ul>
71
+ <li>hash.contain_hash({ &quot;baz&quot; =&gt; &quot;bar&quot; })</li>
72
+ <li>array.only_include(&quot;bar&quot;, &quot;foo&quot;)</li>
73
+ <li>record.should persist(:title, &quot;Blog post&quot;)</li>
74
+ <li>record.should allow(&quot;Blog post&quot;).as(:title)</li>
75
+ </ul>
76
+
77
+ <h3>Model helpers:</h3>
78
+
79
+ <ul>
80
+ <li>reload(post)</li>
81
+ <li>save_and_reload(post)</li>
82
+ </ul>
83
+
84
+ <h3>Acceptance matchers:</h3>
85
+
86
+ <ul>
87
+ <li>page.should have_options([&quot;Yes&quot;, &quot;No&quot;])</li>
88
+ <li>page.should have_table_row(&#39;Posts&#39;, &quot;Title&quot; =&gt; &quot;First&quot;, :year =&gt; &quot;2012&quot;)</li>
89
+ <li>page.should have_attribute(&quot;Status&quot;, &quot;Pending&quot;)</li>
90
+ <li>page.should have_image(&quot;Logo&quot;)</li>
91
+ <li>page.should have_header(&quot;Elabs&quot;)</li>
92
+ <li>page.should have_flash_notice(&quot;Success&quot;)</li>
93
+ <li>page.should have_flash_alert(&quot;Error&quot;)</li>
94
+ <li>page.should have_form_errors_on(&quot;Name&quot;, &quot;Can&#39;t be blank&quot;)</li>
95
+ <li>page.should have_fields(&quot;Author&quot; =&gt; &quot;Adam&quot;, &quot;Year&quot; =&gt; &quot;2011&quot;)</li>
96
+ </ul>
97
+
98
+ <h3>Acceptance helpers:</h3>
99
+
100
+ <ul>
101
+ <li>select_year_and_month(&quot;2010&quot;, &quot;March&quot;, :from =&gt; &quot;Birth date&quot;)</li>
102
+ <li>sign_in_as(user)</li>
103
+ <li>sign_out</li>
104
+ </ul>
105
+
106
+ <h3>Common helpers:</h3>
107
+
108
+ <ul>
109
+ <li>select_year_and_month(&quot;2010&quot;, &quot;March&quot;, :from =&gt; &quot;Birth date&quot;)</li>
110
+ <li>normalize_keys({ &quot;First name&quot; =&gt; &quot;Adam&quot; })</li>
111
+ <li>fixture_file(&quot;file.txt&quot;)</li>
112
+ </ul>
113
+
114
+ <h2>Setup</h2>
115
+
116
+ <p>add elabs_matchers to your Gemfile:</p>
117
+
118
+ <pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span>
119
+ </code></pre>
120
+
121
+ <p>if you&#39;re using Spork gem you need to tell bundler not to require the files for you:</p>
122
+
123
+ <pre class="code ruby"><code><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>elabs_matchers</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:git</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>git://github.com/elabs/elabs_matchers.git</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:require</span> <span class='op'>=&gt;</span> <span class='kw'>false</span>
124
+ </code></pre>
125
+
126
+ <p>then you&#39;ll require them inside your spork prefork block:</p>
127
+
128
+ <pre class="code ruby"><code>Spork.prefork do
129
+ ...
130
+ require 'elabs_matchers'
131
+ ...
132
+ end
133
+ </code></pre>
134
+
135
+ <h2>Development</h2>
136
+
137
+ <pre class="code bash"><code>bundle exec rake
138
+ </code></pre>
139
+
140
+ <p>should run all the gem&#39;s specs.</p>
141
+
61
142
  <h2>TODOS</h2>
62
- <pre class="code">
63
- <span class='mult op'>*</span> <span class='Make constant id'>Make</span> <span class='yard identifier id'>yard</span> <span class='document identifier id'>document</span> <span class='rspec identifier id'>rspec</span> <span class='matchers identifier id'>matchers</span>
64
- <span class='mult op'>*</span> <span class='Use constant id'>Use</span> <span class='matcher identifier id'>matcher</span> <span class='with identifier id'>with</span> <span class='RSpec constant id'>RSpec</span><span class='colon2 op'>::</span><span class='Matchers constant id'>Matchers</span><span class='symbol val'>:DSL</span>
65
- <span class='mult op'>*</span> <span class='Remove constant id'>Remove</span> <span class='Rspec constant id'>Rspec</span> <span class='warning identifier id'>warning</span>
66
- <span class='mult op'>*</span> <span class='Add constant id'>Add</span> <span class='contributors identifier id'>contributors</span>
67
- </pre>
143
+
144
+ <ul>
145
+ <li>Make yard document rspec matchers</li>
146
+ <li>Use matcher with RSpec::Matchers:DSL</li>
147
+ <li>Add contributors</li>
148
+ </ul>
149
+
68
150
  <h2>License:</h2>
69
- <pre class="code">
70
- <span class='lparen token'>(</span><span class='The constant id'>The</span> <span class='MIT constant id'>MIT</span> <span class='License constant id'>License</span><span class='rparen token'>)</span>
71
151
 
72
- <span class='Copyright constant id'>Copyright</span> <span class='lparen token'>(</span><span class='c identifier id'>c</span><span class='rparen token'>)</span> <span class='integer val'>2011</span> <span class='Elabs constant id'>Elabs</span> <span class='AB constant id'>AB</span>
152
+ <p>(The MIT License)</p>
153
+
154
+ <p>Copyright (c) 2012 Elabs AB</p>
73
155
 
74
- <span class='Permission constant id'>Permission</span> <span class='is identifier id'>is</span> <span class='hereby identifier id'>hereby</span> <span class='granted identifier id'>granted</span><span class='comma token'>,</span> <span class='free identifier id'>free</span> <span class='of identifier id'>of</span> <span class='charge identifier id'>charge</span><span class='comma token'>,</span> <span class='to identifier id'>to</span> <span class='any identifier id'>any</span> <span class='person identifier id'>person</span> <span class='obtaining identifier id'>obtaining</span>
75
- <span class='a identifier id'>a</span> <span class='copy identifier id'>copy</span> <span class='of identifier id'>of</span> <span class='this identifier id'>this</span> <span class='software identifier id'>software</span> <span class='and and kw'>and</span> <span class='associated identifier id'>associated</span> <span class='documentation identifier id'>documentation</span> <span class='files identifier id'>files</span> <span class='lparen token'>(</span><span class='the identifier id'>the</span>
76
- <span class='string val'>'Software'</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='to identifier id'>to</span> <span class='deal identifier id'>deal</span> <span class='in in kw'>in</span> <span class='the identifier id'>the</span> <span class='Software constant id'>Software</span> <span class='without identifier id'>without</span> <span class='restriction identifier id'>restriction</span><span class='comma token'>,</span> <span class='including identifier id'>including</span>
77
- <span class='without identifier id'>without</span> <span class='limitation identifier id'>limitation</span> <span class='the identifier id'>the</span> <span class='rights identifier id'>rights</span> <span class='to identifier id'>to</span> <span class='use identifier id'>use</span><span class='comma token'>,</span> <span class='copy identifier id'>copy</span><span class='comma token'>,</span> <span class='modify identifier id'>modify</span><span class='comma token'>,</span> <span class='merge identifier id'>merge</span><span class='comma token'>,</span> <span class='publish identifier id'>publish</span><span class='comma token'>,</span>
78
- <span class='distribute identifier id'>distribute</span><span class='comma token'>,</span> <span class='sublicense identifier id'>sublicense</span><span class='comma token'>,</span> <span class='and and kw'>and</span><span class='regexp val'>/or sell copies of the Software, and to
156
+ <p>Permission is hereby granted, free of charge, to any person obtaining
157
+ a copy of this software and associated documentation files (the
158
+ &#39;Software&#39;), to deal in the Software without restriction, including
159
+ without limitation the rights to use, copy, modify, merge, publish,
160
+ distribute, sublicense, and/or sell copies of the Software, and to
79
161
  permit persons to whom the Software is furnished to do so, subject to
80
- the following conditions:
162
+ the following conditions:</p>
81
163
 
82
- The above copyright notice and this permission notice shall be
83
- included in all copies or substantial portions of the Software.
164
+ <p>The above copyright notice and this permission notice shall be
165
+ included in all copies or substantial portions of the Software.</p>
84
166
 
85
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
167
+ <p>THE SOFTWARE IS PROVIDED &#39;AS IS&#39;, WITHOUT WARRANTY OF ANY KIND,
86
168
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
87
169
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
88
170
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
89
171
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90
172
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
92
- </span></pre>
173
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
93
174
  </div></div>
94
175
 
95
176
  <div id="footer">
96
- Generated on Wed Jun 15 10:20:45 2011 by
177
+ Generated on Fri Feb 17 16:29:16 2012 by
97
178
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
98
- 0.6.5 (ruby-1.8.7).
179
+ 0.7.5 (ruby-1.9.3).
99
180
  </div>
100
181
 
101
182
  </body>
data/doc/js/app.js CHANGED
@@ -2,11 +2,11 @@ function createSourceLinks() {
2
2
  $('.method_details_list .source_code').
3
3
  before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
4
4
  $('.toggleSource').toggle(function() {
5
- $(this).parent().next().slideDown(100);
5
+ $(this).parent().nextAll('.source_code').slideDown(100);
6
6
  $(this).text("Hide source");
7
7
  },
8
8
  function() {
9
- $(this).parent().next().slideUp(100);
9
+ $(this).parent().nextAll('.source_code').slideUp(100);
10
10
  $(this).text("View source");
11
11
  });
12
12
  }
@@ -23,7 +23,7 @@ function createDefineLinks() {
23
23
  function() {
24
24
  $(this).prev().hide();
25
25
  $(this).parent().prev().height(tHeight);
26
- $(this).text("more...")
26
+ $(this).text("more...");
27
27
  });
28
28
  }
29
29
 
@@ -38,7 +38,7 @@ function createFullTreeLinks() {
38
38
  function() {
39
39
  $(this).parent().toggleClass('showAll');
40
40
  $(this).parent().prev().height(tHeight);
41
- $(this).text("show all")
41
+ $(this).text("show all");
42
42
  });
43
43
  }
44
44
 
@@ -93,13 +93,14 @@ function keyboardShortcuts() {
93
93
  if (window.top.frames.main) return;
94
94
  $(document).keypress(function(evt) {
95
95
  if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
96
- if (typeof evt.orignalTarget !== "undefined" &&
97
- (evt.originalTarget.nodeName == "INPUT" ||
98
- evt.originalTarget.nodeName == "TEXTAREA")) return;
96
+ if (typeof evt.target !== "undefined" &&
97
+ (evt.target.nodeName == "INPUT" ||
98
+ evt.target.nodeName == "TEXTAREA")) return;
99
99
  switch (evt.charCode) {
100
100
  case 67: case 99: $('#class_list_link').click(); break; // 'c'
101
101
  case 77: case 109: $('#method_list_link').click(); break; // 'm'
102
102
  case 70: case 102: $('#file_list_link').click(); break; // 'f'
103
+ default: break;
103
104
  }
104
105
  });
105
106
  }
@@ -108,10 +109,10 @@ function summaryToggle() {
108
109
  $('.summary_toggle').click(function() {
109
110
  localStorage.summaryCollapsed = $(this).text();
110
111
  $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
111
- var next = $(this).parent().parent().next();
112
+ var next = $(this).parent().parent().nextAll('ul.summary').first();
112
113
  if (next.hasClass('compact')) {
113
114
  next.toggle();
114
- next.next().toggle();
115
+ next.nextAll('ul.summary').first().toggle();
115
116
  }
116
117
  else if (next.hasClass('summary')) {
117
118
  var list = $('<ul class="summary compact" />');
@@ -139,31 +140,32 @@ function fixOutsideWorldLinks() {
139
140
  }
140
141
 
141
142
  function generateTOC() {
142
- if ($('#filecontents').length == 0) return;
143
+ if ($('#filecontents').length === 0) return;
143
144
  var _toc = $('<ol class="top"></ol>');
144
145
  var show = false;
145
146
  var toc = _toc;
146
147
  var counter = 0;
147
148
  var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
149
+ var i;
148
150
  if ($('#filecontents h1').length > 1) tags.unshift('h1');
149
- for (i in tags) { tags[i] = '#filecontents ' + tags[i] }
150
- var lastTag = parseInt(tags[0][1]);
151
+ for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
152
+ var lastTag = parseInt(tags[0][1], 10);
151
153
  $(tags.join(', ')).each(function() {
152
154
  if (this.id == "filecontents") return;
153
155
  show = true;
154
- var thisTag = parseInt(this.tagName[1]);
155
- if (this.id.length == 0) {
156
+ var thisTag = parseInt(this.tagName[1], 10);
157
+ if (this.id.length === 0) {
156
158
  var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
157
- if ($('#' + proposedId).length > 0) proposedId += counter++;
159
+ if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
158
160
  this.id = proposedId;
159
161
  }
160
162
  if (thisTag > lastTag) {
161
- for (var i = 0; i < thisTag - lastTag; i++) {
163
+ for (i = 0; i < thisTag - lastTag; i++) {
162
164
  var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
163
165
  }
164
166
  }
165
167
  if (thisTag < lastTag) {
166
- for (var i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
168
+ for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
167
169
  }
168
170
  toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
169
171
  lastTag = thisTag;
@@ -185,7 +187,7 @@ function generateTOC() {
185
187
  $(this).text('float');
186
188
  $('#toc').toggleClass('nofloat');
187
189
  }, function() {
188
- $(this).text('left')
190
+ $(this).text('left');
189
191
  $('#toc').toggleClass('nofloat');
190
192
  });
191
193
  }