summaryrefslogtreecommitdiff
path: root/spec/ruby/library/prime/next_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/prime/next_spec.rb')
-rw-r--r--spec/ruby/library/prime/next_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/library/prime/next_spec.rb b/spec/ruby/library/prime/next_spec.rb
index 39c4ae16ae..07e80ab3a5 100644
--- a/spec/ruby/library/prime/next_spec.rb
+++ b/spec/ruby/library/prime/next_spec.rb
@@ -1,7 +1,11 @@
require_relative '../../spec_helper'
-require_relative 'shared/next'
require 'prime'
describe "Prime#next" do
- it_behaves_like :prime_next, :next
+ 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