Sha256: c83ecc170e57ba26e1574eff6b94b7c0dd4ea2e6b52f07b4ac069e83191b8c8d
Contents?: true
Size: 909 Bytes
Versions: 13
Compression:
Stored size: 909 Bytes
Contents
require 'spec_helper' describe SimpleService::ValidatesCommandsProperlyInherit do class ValidDummyCommand < SimpleService::Command def call; true; end end class InvalidDummyCommand def call; true; end end context '#call' do it 'raises error when commands do not inherit from SimpleService::Command' do expect { SimpleService::ValidatesCommandsProperlyInherit.new( provided_commands: [InvalidDummyCommand] ).call }.to raise_error( SimpleService::CommandParentClassInvalidError, 'InvalidDummyCommand - must inherit from SimpleService::Command' ) end it 'does not raises error when commands inherit from SimpleService::Command' do expect { SimpleService::ValidatesCommandsProperlyInherit.new( provided_commands: [ValidDummyCommand] ).call }.to_not raise_error end end end
Version data entries
13 entries across 13 versions & 1 rubygems