Returning different values in sequence using any_instance doesn't work as expected
Created by: dwilkie
The following snipit works well:
foo = mock("Foo")
foo.stub(:bar).and_return('first', 'second', 'other')
p foo.bar
p foo.bar
p foo.bar
Output:
# "first"
# "second"
# "other"
However the following case does not:
Array.any_instance.stub(:sample).and_return('first', 'second', 'other')
p [].sample
p [].sample
p [].sample
Output:
# "first"
# "first"
# "first"