Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alindeman/ancient_mock
https://github.com/alindeman/ancient_mock
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alindeman/ancient_mock
- Owner: alindeman
- License: mit
- Created: 2013-04-05T15:03:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-04-10T12:57:53.000Z (over 11 years ago)
- Last Synced: 2024-10-13T17:51:37.560Z (2 months ago)
- Language: Ruby
- Size: 122 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AncientMock
A simple mock object library that I built on stage at [Ancient City
Ruby](http://ancientcityruby.com).**Do not use in production!** It was an academic exercise meant to teach
the basics of building a mock object library.* Video from the talk (not yet posted)
* [Slides from the talk](https://docs.google.com/presentation/d/1laaQYHFyzcTJzlB9qMmEHyoHIB-S93p9B4L8SbbhoTw/edit#slide=id.p)## Installation
```ruby
# Gemfile
gem 'ancient_mock'
```## Usage
```ruby
warehouse = Object.new# Stub
allow(warhouse).to receive(:full?).and_return(true)
warehouse.full? # => true# Mock
item_id = 1234
expect(warehouse).to receive(:remove).with(item_id)
# warehouse.remove(1234) must be called
```## Tests
```ruby
bundle exec rake
```