Sha256: 0e9d9a361be8821ea377a262d4d73113d7ec356bebbd5836e94816929e2e881b

Contents?: true

Size: 902 Bytes

Versions: 2

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'

describe Mercy::ReportConfig do
  let(:config) { {} }
  let(:parameters) { {} }
  let(:subject) { described_class.new(config) }

  describe '#build' do
    context 'when no config is given' do
      it do
        expect(subject.build(parameters)).to be_a(Mercy::Report::Error)
      end
    end

    context 'when a dummy type is given' do
      let(:config) { { type: :dummy } }

      it do
        expect(subject.build(parameters)).to be_a(Mercy::Report::Dummy)
      end
    end

    context 'when a class is given as type' do
      let(:config) { { type: Mercy::Report::Dummy } }

      it do
        expect(subject.build(parameters)).to be_a(Mercy::Report::Dummy)
      end
    end

    context 'when a global class is given as type' do
      let(:config) { { type: Dummy } }

      it do
        expect(subject.build(parameters)).to be_a(Dummy)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mercy-1.6.0 spec/lib/mercy/report/report_config_spec.rb
mercy-1.5.0 spec/lib/mercy/report/report_config_spec.rb