File: null_strategy_spec.rb

package info (click to toggle)
ruby-database-cleaner 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 768 kB
  • sloc: ruby: 4,854; makefile: 10; sh: 4
file content (28 lines) | stat: -rw-r--r-- 678 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
require 'spec_helper'

module DatabaseCleaner
  describe NullStrategy do
      it 'responds to .start' do
        expect { NullStrategy.start }.not_to raise_error(NoMethodError)
      end

      it 'responds to .clean' do
        expect { NullStrategy.clean }.not_to raise_error(NoMethodError)
      end

      describe '.cleaning' do
        it 'fails without a block' do
          expect { NullStrategy.cleaning }.to raise_error(LocalJumpError)
        end

        it 'no-ops with a block' do
          effect = double
          expect(effect).to receive(:occur).once

          NullStrategy.cleaning do
            effect.occur
          end
        end
      end
  end
end