summaryrefslogtreecommitdiff
path: root/spec/ruby/core/argf/shared/getc.rb
blob: 8be39c60b6fd78150df0fef5864d3cb8c7268d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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