Sha256: e29a618d6b03b2def4d2c07f0d41e5df16025af2e7093974ce8840386b54c19f

Contents?: true

Size: 712 Bytes

Versions: 13

Compression:

Stored size: 712 Bytes

Contents

require 'spec_helper'

describe SimpleService::ValidatesCommandsNotEmpty do

  class DummyCommand < SimpleService::Command
    def call; true; end
  end

  context '#call' do

    it 'raises error when commands are not defined' do
      expect {
        SimpleService::ValidatesCommandsNotEmpty.new(provided_commands: nil).call
      }.to raise_error(
        SimpleService::OrganizerCommandsNotDefinedError,
        'This Organizer class does not contain any command definitions'
      )
    end

    it 'does not raise error when commands are defined' do
      expect {
        SimpleService::ValidatesCommandsNotEmpty.new(provided_commands: [DummyCommand]).call
      }.to_not raise_error
    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
simple_service-1.4.1 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.4.0 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.91 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.9 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.8 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.5 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.4 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.3 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.2 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.1 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.3.0 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.2.6 spec/lib/commands/validates_commands_not_empty_spec.rb
simple_service-1.2.5 spec/lib/commands/validates_commands_not_empty_spec.rb