Permalink
Browse files

putting guards around tests and index value

  • Loading branch information...
1 parent 208e179 commit 8a26fbffeda3b49a12ef7ccb8b38d355d2bb78f9 @cheezy committed Jul 10, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 features/step_definitions/data_magic_steps.rb
  2. +1 −0 lib/data_magic/translation.rb
@@ -13,6 +13,7 @@ class TestClass
end
When /^I ask for the data for "(.+)"$/ do |key|
+ TestClass.instance_variable_set "@private_firstsecond_index", 0
@tc = TestClass.new
@data = @tc.data_for key
end
@@ -241,6 +241,7 @@ def randomize(value)
def sequential(value)
index = index_variable_for(value)
index = (index ? index + 1 : 0)
+ index = 0 if index == value.length
set_index_variable(value, index)
value[index]
end

0 comments on commit 8a26fbf

Please sign in to comment.