Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

putting guards around tests and index value

  • Loading branch information...
commit 8a26fbffeda3b49a12ef7ccb8b38d355d2bb78f9 1 parent 208e179
Jeff Morgan authored
1  features/step_definitions/data_magic_steps.rb
View
@@ -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
1  lib/data_magic/translation.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.