File: getting_started.md

package info (click to toggle)
ruby-bogus 0.1.5-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 828 kB
  • ctags: 628
  • sloc: ruby: 4,124; makefile: 6; sh: 2
file content (36 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Installation

To install Bogus, all you need to do is add:

    gem "bogus"

to your Gemfile.

## Configuration

In your `spec_helper.rb`, require bogus:

    require 'bogus/rspec'

Bogus will hook into RSpec on it's own, but if you want to be explicit about the used mock framework, you can put this in your `spec_helper.rb`:

    RSpec.configure do |c|
      # already done by requiring bogus/rspec
      c.mock_with Bogus::RSpecAdapter
    end

And configure it to look for classes in your namespace:

    Bogus.configure do |c|
      c.search_modules << My::Namespace
    end

You will probably also want to create a configuration file for your fakes (for example `spec/support/fakes.rb`):

    Bogus.fakes do
      # fakes go here
    end

and require it in your gem file:

    require_relative 'support/fakes.rb'