Sha256: 81a18f1436741490d97078ac2dd99a32c1c5a8470d9dc0ccf8e2cba586bd1164

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

module PaperTrailScrapbook
  ::RSpec.describe Config do
    describe '.instance' do
      it 'returns the singleton instance' do
        expect { described_class.instance }.not_to raise_error
        expect(described_class.instance.whodunnit_class).to equal(Person).or be_nil
        expect(described_class.instance.time_format)
          .to eql(described_class::DEFAULT_TIME_FORMAT)
        expect(described_class.instance.events)
          .to eql(described_class::DEFAULT_EVENTS)
        expect(described_class.instance.scrub_columns)
          .to eql(described_class::SCRUB_COLUMNS)
        expect(described_class.instance.unknown_whodunnit)
          .to eql(described_class::UNKNOWN_WHODUNNIT)

        expect(described_class.instance.drop_id_suffix)
          .to be true
        expect(described_class.instance.filter_non_changes)
          .to be true
      end
    end

    describe '.new' do
      it 'raises NoMethodError' do
        expect { described_class.new }.to raise_error(NoMethodError)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
paper_trail_scrapbook-0.1.9 spec/paper_trail_scrapbook/config_spec.rb
paper_trail_scrapbook-0.1.8 spec/paper_trail_scrapbook/config_spec.rb