Sha256: bf249ef178f4938724083a1e307d718f1a5c7300c4e6a73a19bb459121c85e77

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 Bytes

Contents

# frozen_string_literal: true

describe ServiceIt::Base do
  context 'when calls new method' do
    subject { described_class.new }

    it 'raises NoMethodError exception' do
      expect { subject }.to raise_error(NoMethodError)
    end
  end

  describe SayMyName do
    context 'when I ask what is my name' do
      subject { described_class.call(name: name) }

      let(:name) { 'Heisenberg' }

      it 'says Heisenberg' do
        expect(subject).to eq(name)
      end
    end
  end

  describe MissedPerformService do
    context 'when perform method is not defined' do
      subject { described_class.call }

      it 'raises NotImplementedError exception' do
        expect { subject }.to raise_error(NotImplementedError)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
service_it-2.0.0 spec/service_it/base_spec.rb