Sha256: 6e308de7285243a511a83b7e580a02a253857b503cb6ab7e76d714a508dd59bf

Contents?: true

Size: 932 Bytes

Versions: 6

Compression:

Stored size: 932 Bytes

Contents

require 'spec_helper'

describe Bidu::House::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(Bidu::House::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(Bidu::House::Report::Dummy)
      end
    end

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

      it do
        expect(subject.build(parameters)).to be_a(Bidu::House::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

6 entries across 6 versions & 1 rubygems

Version Path
bidu-house-1.3.0 spec/lib/bidu/house/report/report_config_spec.rb
bidu-house-1.2.0 spec/lib/bidu/house/report/report_config_spec.rb
bidu-house-1.1.0 spec/lib/bidu/house/report/report_config_spec.rb
bidu-house-1.0.0 spec/lib/bidu/house/report/report_config_spec.rb
bidu-house-0.2.1 spec/lib/bidu/house/report/report_config_spec.rb
bidu-house-0.2.0 spec/lib/bidu/house/report/report_config_spec.rb