aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/prime/shared/next.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/prime/shared/next.rb')
-rw-r--r--spec/rubyspec/library/prime/shared/next.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/rubyspec/library/prime/shared/next.rb b/spec/rubyspec/library/prime/shared/next.rb
new file mode 100644
index 0000000000..f79b2c051e
--- /dev/null
+++ b/spec/rubyspec/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