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

chuyeow / facon

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 18
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (3)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (3)
    • 0.3-stable
    • gh-pages
    • master ✓
  • Tags (3)
    • 0.4.1
    • 0.4.0
    • 0.3.1
Sending Request…
Click here to lend your support to: facon 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.

Facon is a mocking library in the spirit of the Bacon spec library. Small, compact, and works with Bacon. — Read more

  cancel

http://rubyforge.org/projects/facon/

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

This URL has Read+Write access

Update version number -_-". 
chuyeow (author)
Thu Dec 04 23:40:33 -0800 2008
commit  8303072812d1dd26894df670f4d638ed7316cfe6
tree    f3869c35021328e90ffa16f7d0210af826127f9f
parent  89181b4a057f8bbdd2a1e5935fdf6149fcb9184c
facon /
name age
history
message
file .gitignore Fri Aug 08 09:59:20 -0700 2008 Added expectation times methods [raggi]
file Changelog.txt Thu Dec 04 23:36:39 -0800 2008 Add a changelog and a Contributors section in R... [chuyeow]
file History.txt Mon Feb 18 22:21:03 -0800 2008 Fixed a bug where mocks were not being teared d... [chuyeow]
file Manifest.txt Thu Dec 04 23:36:39 -0800 2008 Add a changelog and a Contributors section in R... [chuyeow]
file README.txt Thu Dec 04 23:36:39 -0800 2008 Add a changelog and a Contributors section in R... [chuyeow]
file Rakefile Thu Dec 04 22:54:02 -0800 2008 Update version to 0.4.0. [chuyeow]
directory lib/ Thu Dec 04 23:40:33 -0800 2008 Update version number -_-". [chuyeow]
directory spec/ Thu Dec 04 23:23:01 -0800 2008 Add specs for #times, #once and #never expectat... [chuyeow]
README.txt
= Facon

Facon is a mocking library in the spirit of the Bacon spec library. Small, compact, and works with Bacon.

== Synopsis

To use Facon with Bacon[http://rubyforge.org/projects/test-spec/], simply <code>require 'facon'</code> and you're done.

You can now write Bacon specs like this (in RSpec-like style):

  require 'bacon'
  require 'facon'

  describe 'PersonController' do
    before do
      @konata = mock('konata', :id => 1, :name => 'Konata Izumi')
      @kagami = mock('kagami', :id => 2, :name => 'Kagami Hiiragi')
    end

    it "should find all people on GET to 'index'" do
      Person.should.receive(:find).with(:all).and_return([@konata, @kagami])

      get('/people/index')
    end

    it "should find the person with id of 1 on Get to 'show/1'" do
      Person.should.receive(:find).with(1).and_return(@konata)

      get('/people/show/1')
    end
  end

For now, more examples can be found in the specs included with the Facon gem. I promise to get better examples into the
documentation!

See Facon::Baconize for more documentation on using Facon with Bacon[http://rubyforge.org/projects/test-spec/].

== Requirements

* Ruby 1.8
* Bacon (optional, required for running specs)

== Compatibility with Bacon

When used with Bacon, Facon uses some Bacon hooks, which unfortunately causes some compatibility issues with new
versions of Bacon. Use this compatibility chart to find out which versions of Facon to install when running with Bacon.

Facon version -- Bacon version
<= 0.3.x      -- 0.9 (only tested with 0.9 but might work with earlier versions of Bacon)
0.4           -- 1.0, 1.1

== Installation

Simply install the gem:
  gem install facon

== The Source Code

You can get the latest trunk from the Git repository on Github:
  git://github.com/chuyeow/facon.git

== Links

* Github page - http://github.com/chuyeow/facon/
* Facon website - http://facon.rubyforge.org/
* Bacon - http://rubyforge.org/projects/test-spec/
* RSpec - http://rspec.info/

== Todos

* test/unit and RSpec integration.
* Remove the $facon_mocks global.
* Throw away unnecessary code.
* Implement exactly, at_least, at_most expectations.

== Contributors

* raggi (http://blog.ra66i.org/) for #times, #once, #never expectation matchers.

== Thanks to

* RSpec (http://rspec.info/) for creating spec/mocks, from which a lot of the code for Facon is stolen.
* Christian Neukirchen (http://rubyforge.org/projects/test-spec/) for creating Bacon.

== License:

(The MIT License)

Copyright (c) 2008 Cheah Chu Yeow

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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