Remove trailing space from error message

This commit is contained in:
Oleksandr Avoyants 2017-08-16 13:47:24 +03:00
parent f9048b7496
commit 5e29fe5de4
3 changed files with 4 additions and 4 deletions

View File

@ -7,11 +7,11 @@ module AASM
def initialize(object, event_name, state_machine_name, failures = [])
@object, @event_name, @originating_state, @failures = object, event_name, object.aasm(state_machine_name).current_state, failures
super("Event '#{event_name}' cannot transition from '#{originating_state}'. #{reasoning}")
super("Event '#{event_name}' cannot transition from '#{originating_state}'.#{reasoning}")
end
def reasoning
"Failed callback(s): #{failures}." unless failures.empty?
" Failed callback(s): #{failures}." unless failures.empty?
end
end

View File

@ -5,7 +5,7 @@ describe AASM::InvalidTransition do
process = ProcessWithNewDsl.new
expect { process.stop! }.to raise_error do |err|
process.start
expect(err.message).to eql("Event 'stop' cannot transition from 'sleeping'. ")
expect(err.message).to eql("Event 'stop' cannot transition from 'sleeping'.")
end
end
end

View File

@ -6,7 +6,7 @@ describe 'transitions' do
process = ProcessWithNewDsl.new
expect { process.stop! }.to raise_error do |err|
expect(err.class).to eql(AASM::InvalidTransition)
expect(err.message).to eql("Event 'stop' cannot transition from 'sleeping'. ")
expect(err.message).to eql("Event 'stop' cannot transition from 'sleeping'.")
expect(err.object).to eql(process)
expect(err.event_name).to eql(:stop)
end