Sha256: 300713cae1993382c8d9e736b9f8c19a9ec9c65279c431ee0605179a6fdb695b

Contents?: true

Size: 476 Bytes

Versions: 3

Compression:

Stored size: 476 Bytes

Contents

require 'spec_helper'
require 'hosts_file/file'

describe HostsFile::File do
  around(:each) do |example|
    TempDir.create do |dir|
      @dir = dir
      example.run
    end
  end

  it "should handle basic use" do
    file = HostsFile::File.new("")
    file.should be_kind_of(HostsFile::File)
  end

  it "should handle file" do
    test_file = @dir.file("hosts", "1.1.1.1 hostname")
    file = HostsFile::File.new(test_file)
    file.hosts.length.should eql(1)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hosts_file-1.0.3 spec/hosts_file/file_spec.rb
hosts_file-0.0.2 spec/hosts_file/file_spec.rb
hosts_file-0.0.1 spec/hosts_file/file_spec.rb