File: tracks_existence_of_test_doubles_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-- 571 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
require 'spec_helper'

describe Bogus::TracksExistenceOfTestDoubles do
  let(:tracker) { Bogus::TracksExistenceOfTestDoubles.new }

  it "returns an empty double list with nothing tracked" do
    expect(tracker.doubles).to eq([])
  end

  it "lists the added test doubles in order without duplicates" do
    foo = "foo"
    bar = 1
    baz = Object.new

    tracker.track foo
    tracker.track bar
    tracker.track foo
    tracker.track baz
    tracker.track baz
    tracker.track bar
    tracker.track foo


    expect(tracker.doubles).to eq([foo, bar, baz])
  end
end