Sha256: 140a634a5d030c3ae4665ee52e0b20d289e8be5c005b036ada3744fa17f56ef5

Contents?: true

Size: 876 Bytes

Versions: 17

Compression:

Stored size: 876 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 => ["Schemes::HTTP", "Formats::HTML"])
  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

17 entries across 17 versions & 1 rubygems

Version Path
imw-0.2.18 spec/imw/schemes/remote_spec.rb
imw-0.2.17 spec/imw/schemes/remote_spec.rb
imw-0.2.16 spec/imw/schemes/remote_spec.rb
imw-0.2.15 spec/imw/schemes/remote_spec.rb
imw-0.2.14 spec/imw/schemes/remote_spec.rb
imw-0.2.13 spec/imw/schemes/remote_spec.rb
imw-0.2.12 spec/imw/schemes/remote_spec.rb
imw-0.2.11 spec/imw/schemes/remote_spec.rb
imw-0.2.10 spec/imw/schemes/remote_spec.rb
imw-0.2.9 spec/imw/schemes/remote_spec.rb
imw-0.2.8 spec/imw/schemes/remote_spec.rb
imw-0.2.7 spec/imw/schemes/remote_spec.rb
imw-0.2.6 spec/imw/schemes/remote_spec.rb
imw-0.2.5 spec/imw/schemes/remote_spec.rb
imw-0.2.4 spec/imw/schemes/remote_spec.rb
imw-0.2.3 spec/imw/schemes/remote_spec.rb
imw-0.2.2 spec/imw/schemes/remote_spec.rb