diff options
Diffstat (limited to 'spec/ruby/core/argf/shared/getc.rb')
-rw-r--r-- | spec/ruby/core/argf/shared/getc.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/ruby/core/argf/shared/getc.rb b/spec/ruby/core/argf/shared/getc.rb new file mode 100644 index 0000000000..8be39c60b6 --- /dev/null +++ b/spec/ruby/core/argf/shared/getc.rb @@ -0,0 +1,17 @@ +describe :argf_getc, shared: true do + before :each do + @file1 = fixture __FILE__, "file1.txt" + @file2 = fixture __FILE__, "file2.txt" + + @chars = File.read @file1 + @chars += File.read @file2 + end + + it "reads each char of files" do + argf [@file1, @file2] do + chars = "" + @chars.size.times { chars << @argf.send(@method) } + chars.should == @chars + end + end +end |