Skip to content

Commit

Permalink
Create gh-pages branch via GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Dec 27, 2012
0 parents commit 0f00868
Show file tree
Hide file tree
Showing 12 changed files with 813 additions and 0 deletions.
Binary file added images/body-bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/highlight-bg.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hr.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/octocat-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tar-gz-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zip-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions index.html
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>shoulda-matchers by thoughtbot</title>
</head>

<body>
<div id="container">
<div class="inner">

<header>
<h1>shoulda-matchers</h1>
<h2>Collection of testing matchers extracted from Shoulda</h2>
</header>

<section id="downloads" class="clearfix">
<a href="https://github.com/thoughtbot/shoulda-matchers/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
<a href="https://github.com/thoughtbot/shoulda-matchers/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
<a href="https://github.com/thoughtbot/shoulda-matchers" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>

<hr>

<section id="main_content">
<h1>shoulda-matchers</h1>

<p><a href="http://travis-ci.org/thoughtbot/shoulda-matchers"><img src="https://secure.travis-ci.org/thoughtbot/shoulda-matchers.png?branch=master" alt="Build Status"></a></p>

<p><a href="http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames">Official Documentation</a></p>

<p>Test::Unit- and RSpec-compatible one-liners that test common Rails functionality.
These tests would otherwise be much longer, more complex, and error-prone.</p>

<p>Refer to the <a href="https://github.com/thoughtbot/shoulda-context">shoulda-context</a> gem if you want to know more
about using shoulda with Test::Unit.</p>

<h2>ActiveRecord Matchers</h2>

<p>Matchers to test associations:</p>

<div class="highlight"><pre><span class="n">describe</span> <span class="no">Post</span> <span class="k">do</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">belong_to</span><span class="p">(</span><span class="ss">:user</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">have_many</span><span class="p">(</span><span class="ss">:tags</span><span class="p">)</span><span class="o">.</span><span class="n">through</span><span class="p">(</span><span class="ss">:taggings</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>

<span class="n">describe</span> <span class="no">User</span> <span class="k">do</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">have_many</span><span class="p">(</span><span class="ss">:posts</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
</pre></div>

<h2>ActiveModel Matchers</h2>

<p>Matchers to test validations and mass assignments:</p>

<div class="highlight"><pre><span class="n">describe</span> <span class="no">Post</span> <span class="k">do</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">validate_uniqueness_of</span><span class="p">(</span><span class="ss">:title</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">validate_uniqueness_of</span><span class="p">(</span><span class="ss">:title</span><span class="p">)</span><span class="o">.</span><span class="n">scoped_to</span><span class="p">(</span><span class="ss">:user_id</span><span class="p">,</span> <span class="ss">:category_id</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">validate_presence_of</span><span class="p">(</span><span class="ss">:body</span><span class="p">)</span><span class="o">.</span><span class="n">with_message</span><span class="p">(</span><span class="sr">/wtf/</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">validate_presence_of</span><span class="p">(</span><span class="ss">:title</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">validate_numericality_of</span><span class="p">(</span><span class="ss">:user_id</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">ensure_inclusion_of</span><span class="p">(</span><span class="ss">:status</span><span class="p">)</span><span class="o">.</span><span class="n">in_array</span><span class="p">(</span><span class="o">[</span><span class="s1">'draft'</span><span class="p">,</span> <span class="s1">'public'</span><span class="o">]</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>

<span class="n">describe</span> <span class="no">User</span> <span class="k">do</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should_not</span> <span class="n">allow_value</span><span class="p">(</span><span class="s2">"blah"</span><span class="p">)</span><span class="o">.</span><span class="n">for</span><span class="p">(</span><span class="ss">:email</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">allow_value</span><span class="p">(</span><span class="s2">"a@b.com"</span><span class="p">)</span><span class="o">.</span><span class="n">for</span><span class="p">(</span><span class="ss">:email</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">ensure_inclusion_of</span><span class="p">(</span><span class="ss">:age</span><span class="p">)</span><span class="o">.</span><span class="n">in_range</span><span class="p">(</span><span class="mi">1</span><span class="o">.</span><span class="n">.</span><span class="mi">100</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should_not</span> <span class="n">allow_mass_assignment_of</span><span class="p">(</span><span class="ss">:password</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
</pre></div>

<h2>ActionController Matchers</h2>

<p>Matchers to test common patterns:</p>

<div class="highlight"><pre><span class="n">describe</span> <span class="no">PostsController</span><span class="p">,</span> <span class="s2">"#show"</span> <span class="k">do</span>
<span class="n">context</span> <span class="s2">"for a fictional user"</span> <span class="k">do</span>
<span class="n">before</span> <span class="k">do</span>
<span class="n">get</span> <span class="ss">:show</span><span class="p">,</span> <span class="ss">:id</span> <span class="o">=&gt;</span> <span class="mi">1</span>
<span class="k">end</span>

<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">assign_to</span><span class="p">(</span><span class="ss">:user</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">respond_with</span><span class="p">(</span><span class="ss">:success</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">render_template</span><span class="p">(</span><span class="ss">:show</span><span class="p">)</span> <span class="p">}</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should_not</span> <span class="n">set_the_flash</span> <span class="p">}</span>
<span class="k">end</span>
<span class="k">end</span>
</pre></div>

<h2>Independent Matchers</h2>

<p>Matchers to test non-Rails-dependent code:</p>

<div class="highlight"><pre><span class="n">describe</span> <span class="no">Human</span> <span class="k">do</span>
<span class="n">it</span> <span class="p">{</span> <span class="n">should</span> <span class="n">delegate_method</span><span class="p">(</span><span class="ss">:work</span><span class="p">)</span><span class="o">.</span><span class="n">to</span><span class="p">(</span><span class="ss">:robot</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
</pre></div>

<h2>Installation</h2>

<p>In Rails 3 and Bundler, add the following to your Gemfile:</p>

<div class="highlight"><pre><span class="n">group</span> <span class="ss">:test</span> <span class="k">do</span>
<span class="n">gem</span> <span class="s2">"shoulda-matchers"</span>
<span class="k">end</span>

<span class="c1"># rspec-rails needs to be in the development group so that Rails generators</span>
<span class="c1"># work.</span>
<span class="n">group</span> <span class="ss">:development</span><span class="p">,</span> <span class="ss">:test</span> <span class="k">do</span>
<span class="n">gem</span> <span class="s2">"rspec-rails"</span>
<span class="k">end</span>
</pre></div>

<p>Shoulda will automatically include matchers into the appropriate example groups.</p>

<h2>Credits</h2>

<p>Shoulda is maintained and funded by <a href="http://thoughtbot.com/community">thoughtbot</a>.
Thank you to all the <a href="https://github.com/thoughtbot/shoulda-matchers/contributors">contributors</a>.</p>

<h2>License</h2>

<p>Shoulda is Copyright © 2006-2012 thoughtbot, inc.
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.</p>
</section>

<footer>
shoulda-matchers is maintained by <a href="https://github.com/thoughtbot">thoughtbot</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="http://twitter.com/jasonlong">Jason Long</a>.
</footer>


</div>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions javascripts/main.js
@@ -0,0 +1 @@
console.log('This would be the main JS file.');
1 change: 1 addition & 0 deletions params.json
@@ -0,0 +1 @@
{"name":"shoulda-matchers","tagline":"Collection of testing matchers extracted from Shoulda","body":"# shoulda-matchers\r\n\r\n[![Build Status](https://secure.travis-ci.org/thoughtbot/shoulda-matchers.png?branch=master)](http://travis-ci.org/thoughtbot/shoulda-matchers)\r\n\r\n[Official Documentation](http://rubydoc.info/github/thoughtbot/shoulda-matchers/master/frames)\r\n\r\nTest::Unit- and RSpec-compatible one-liners that test common Rails functionality.\r\nThese tests would otherwise be much longer, more complex, and error-prone.\r\n\r\nRefer to the [shoulda-context](https://github.com/thoughtbot/shoulda-context) gem if you want to know more\r\nabout using shoulda with Test::Unit.\r\n\r\n## ActiveRecord Matchers\r\n\r\nMatchers to test associations:\r\n\r\n```ruby\r\ndescribe Post do\r\n it { should belong_to(:user) }\r\n it { should have_many(:tags).through(:taggings) }\r\nend\r\n\r\ndescribe User do\r\n it { should have_many(:posts) }\r\nend\r\n```\r\n\r\n## ActiveModel Matchers\r\n\r\nMatchers to test validations and mass assignments:\r\n\r\n```ruby\r\ndescribe Post do\r\n it { should validate_uniqueness_of(:title) }\r\n it { should validate_uniqueness_of(:title).scoped_to(:user_id, :category_id) }\r\n it { should validate_presence_of(:body).with_message(/wtf/) }\r\n it { should validate_presence_of(:title) }\r\n it { should validate_numericality_of(:user_id) }\r\n it { should ensure_inclusion_of(:status).in_array(['draft', 'public']) }\r\nend\r\n\r\ndescribe User do\r\n it { should_not allow_value(\"blah\").for(:email) }\r\n it { should allow_value(\"a@b.com\").for(:email) }\r\n it { should ensure_inclusion_of(:age).in_range(1..100) }\r\n it { should_not allow_mass_assignment_of(:password) }\r\nend\r\n```\r\n\r\n## ActionController Matchers\r\n\r\nMatchers to test common patterns:\r\n\r\n```ruby\r\ndescribe PostsController, \"#show\" do\r\n context \"for a fictional user\" do\r\n before do\r\n get :show, :id => 1\r\n end\r\n\r\n it { should assign_to(:user) }\r\n it { should respond_with(:success) }\r\n it { should render_template(:show) }\r\n it { should_not set_the_flash }\r\n end\r\nend\r\n```\r\n\r\n## Independent Matchers\r\n\r\nMatchers to test non-Rails-dependent code:\r\n\r\n```ruby\r\ndescribe Human do\r\n it { should delegate_method(:work).to(:robot) }\r\nend\r\n```\r\n\r\n## Installation\r\n\r\nIn Rails 3 and Bundler, add the following to your Gemfile:\r\n\r\n```ruby\r\ngroup :test do\r\n gem \"shoulda-matchers\"\r\nend\r\n\r\n# rspec-rails needs to be in the development group so that Rails generators\r\n# work.\r\ngroup :development, :test do\r\n gem \"rspec-rails\"\r\nend\r\n```\r\n\r\nShoulda will automatically include matchers into the appropriate example groups.\r\n\r\n## Credits\r\n\r\nShoulda is maintained and funded by [thoughtbot](http://thoughtbot.com/community).\r\nThank you to all the [contributors](https://github.com/thoughtbot/shoulda-matchers/contributors).\r\n\r\n## License\r\n\r\nShoulda is Copyright © 2006-2012 thoughtbot, inc.\r\nIt is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
226 changes: 226 additions & 0 deletions stylesheets/print.css
@@ -0,0 +1,226 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body {
font-size: 13px;
line-height: 1.5;
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
color: #000;
}

a {
color: #d5000d;
font-weight: bold;
}

header {
padding-top: 35px;
padding-bottom: 10px;
}

header h1 {
font-weight: bold;
letter-spacing: -1px;
font-size: 48px;
color: #303030;
line-height: 1.2;
}

header h2 {
letter-spacing: -1px;
font-size: 24px;
color: #aaa;
font-weight: normal;
line-height: 1.3;
}
#downloads {
display: none;
}
#main_content {
padding-top: 20px;
}

code, pre {
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
color: #222;
margin-bottom: 30px;
font-size: 12px;
}

code {
padding: 0 3px;
}

pre {
border: solid 1px #ddd;
padding: 20px;
overflow: auto;
}
pre code {
padding: 0;
}

ul, ol, dl {
margin-bottom: 20px;
}


/* COMMON STYLES */

table {
width: 100%;
border: 1px solid #ebebeb;
}

th {
font-weight: 500;
}

td {
border: 1px solid #ebebeb;
text-align: center;
font-weight: 300;
}

form {
background: #f2f2f2;
padding: 20px;

}


/* GENERAL ELEMENT TYPE STYLES */

h1 {
font-size: 2.8em;
}

h2 {
font-size: 22px;
font-weight: bold;
color: #303030;
margin-bottom: 8px;
}

h3 {
color: #d5000d;
font-size: 18px;
font-weight: bold;
margin-bottom: 8px;
}

h4 {
font-size: 16px;
color: #303030;
font-weight: bold;
}

h5 {
font-size: 1em;
color: #303030;
}

h6 {
font-size: .8em;
color: #303030;
}

p {
font-weight: 300;
margin-bottom: 20px;
}

a {
text-decoration: none;
}

p a {
font-weight: 400;
}

blockquote {
font-size: 1.6em;
border-left: 10px solid #e9e9e9;
margin-bottom: 20px;
padding: 0 0 0 30px;
}

ul li {
list-style: disc inside;
padding-left: 20px;
}

ol li {
list-style: decimal inside;
padding-left: 3px;
}

dl dd {
font-style: italic;
font-weight: 100;
}

footer {
margin-top: 40px;
padding-top: 20px;
padding-bottom: 30px;
font-size: 13px;
color: #aaa;
}

footer a {
color: #666;
}

/* MISC */
.clearfix:after {
clear: both;
content: '.';
display: block;
visibility: hidden;
height: 0;
}

.clearfix {display: inline-block;}
* html .clearfix {height: 1%;}
.clearfix {display: block;}

0 comments on commit 0f00868

Please sign in to comment.