Sha256: e2aa41b356048d4e9f0e9548ae42f814c2041217aedd31f3659e10ff4fecfec7

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

require File.join(File.dirname(__FILE__),'../../spec_helper')

describe IMW::Schemes::Remote::Base do
end

describe IMW::Schemes::Remote::RemoteFile do

  before do
    # skip modules or else it will automatically become HTML!
    @file = IMW.open('http://www.google.com', :skip_modules => true)
    @file.extend(IMW::Schemes::Remote::Base)
  end

  describe 'with the file' do

    it "can read a remote file" do
      @file.read.size.should > 0
    end

    it "can load the lines of a remote file" do
      data = @file.load
      data.size.should > 0
      data.class.should == Array
    end

    it "can iterate over the lines of a remote file" do
      @file.load do |line|
        line.class.should == String
        break
      end
    end

    it "can map the lines of a remote file" do
      @file.map do |line|
        line[0..5]
      end.class.should == Array
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
imw-0.2.1 spec/imw/schemes/remote_spec.rb