From 5e29fe5de4fbb582d19f08b2fa926f5a54467c44 Mon Sep 17 00:00:00 2001 From: Oleksandr Avoyants Date: Wed, 16 Aug 2017 13:47:24 +0300 Subject: [PATCH] Remove trailing space from error message --- lib/aasm/errors.rb | 4 ++-- spec/unit/exception_spec.rb | 2 +- spec/unit/transition_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/aasm/errors.rb b/lib/aasm/errors.rb index 3fda3b9..751fd35 100644 --- a/lib/aasm/errors.rb +++ b/lib/aasm/errors.rb @@ -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 diff --git a/spec/unit/exception_spec.rb b/spec/unit/exception_spec.rb index 5c04d18..fcb2818 100644 --- a/spec/unit/exception_spec.rb +++ b/spec/unit/exception_spec.rb @@ -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 diff --git a/spec/unit/transition_spec.rb b/spec/unit/transition_spec.rb index 2510f52..7a15771 100644 --- a/spec/unit/transition_spec.rb +++ b/spec/unit/transition_spec.rb @@ -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