1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

MiniTest compat: don't shadow @name

This commit is contained in:
Jeremy Kemper 2008-11-22 18:21:48 -08:00
parent 51383c57a2
commit 0492759db3
2 changed files with 5 additions and 5 deletions

View file

@ -2,18 +2,18 @@ require 'test_helper'
class EventTest < ActiveModel::TestCase
def setup
@name = :close_order
@state_name = :close_order
@success = :success_callback
end
def new_event
@event = ActiveModel::StateMachine::Event.new(nil, @name, {:success => @success}) do
@event = ActiveModel::StateMachine::Event.new(nil, @state_name, {:success => @success}) do
transitions :to => :closed, :from => [:open, :received]
end
end
test 'should set the name' do
assert_equal @name, new_event.name
assert_equal @state_name, new_event.name
end
test 'should set the success option' do

View file

@ -9,13 +9,13 @@ end
class StateTest < ActiveModel::TestCase
def setup
@name = :astate
@state_name = :astate
@machine = StateTestSubject.state_machine
@options = { :crazy_custom_key => 'key', :machine => @machine }
end
def new_state(options={})
ActiveModel::StateMachine::State.new(@name, @options.merge(options))
ActiveModel::StateMachine::State.new(@state_name, @options.merge(options))
end
test 'sets the name' do