File: record_interactions_spec.rb

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 (26 lines) | stat: -rw-r--r-- 645 bytes parent folder | download
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
require 'spec_helper'

describe Bogus::RecordInteractions do

  class SampleRecordsInteractions
    include Bogus::RecordInteractions
  end

  let(:sample) { SampleRecordsInteractions.new }

  it "allows verifying that interactions happened" do
    sample.__record__(:foo, 1, 2, 3)

    expect(sample.__shadow__.has_received(:foo, [1,2,3])).to be_true
  end

  it "allows verifying that interactions didn't happen" do
    sample.__record__(:bar)

    expect(sample.__shadow__.has_received(:foo, [1,2,3])).to be_false
  end

  it "returns self from record by default" do
    expect(sample.__record__(:foo)).to be_a_default_return_value
  end
end