diff options
Diffstat (limited to 'spec/ruby/library/prime/shared')
-rw-r--r-- | spec/ruby/library/prime/shared/next.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/library/prime/shared/next.rb b/spec/ruby/library/prime/shared/next.rb new file mode 100644 index 0000000000..f79b2c051e --- /dev/null +++ b/spec/ruby/library/prime/shared/next.rb @@ -0,0 +1,8 @@ +describe :prime_next, shared: true do + it "returns the element at the current position and moves forward" do + p = Prime.instance.each + p.next.should == 2 + p.next.should == 3 + p.next.next.should == 6 + end +end |