Restructure error sentence per @alto suggestion
Fix failing spec by adding period Use upstream version of Proc handling Fix spacing Restart travis
This commit is contained in:
parent
80b941f277
commit
134129ee82
|
@ -58,7 +58,7 @@ module AASM::Core
|
|||
failures << code unless result
|
||||
result
|
||||
when Proc
|
||||
result = (code.arity == 0 ? record.instance_exec(&code) : record.instance_exec(*args, &code))
|
||||
result = (code.parameters.size == 0 ? record.instance_exec(&code) : record.instance_exec(*args, &code))
|
||||
failures << code.source_location.join('#') unless result
|
||||
result
|
||||
when Array
|
||||
|
|
|
@ -10,11 +10,11 @@ module AASM
|
|||
end
|
||||
|
||||
def message
|
||||
"Event '#{event_name}' cannot transition from '#{object.aasm(state_machine_name).current_state}'#{reasoning}"
|
||||
"Event '#{event_name}' cannot transition from '#{object.aasm(state_machine_name).current_state}'. #{reasoning}"
|
||||
end
|
||||
|
||||
def reasoning
|
||||
". Failed callback(s): #{@failures}." unless failures.empty?
|
||||
"Failed callback(s): #{@failures}." unless failures.empty?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue