Sha256: 2f2f1efa51d342783a58dace14e7a1793116be272a6a5b2db05390cf9ced52ce

Contents?: true

Size: 806 Bytes

Versions: 5

Compression:

Stored size: 806 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe "File extensions for VFS" do

  it "should delegate to File.directory?" do
    delegate_to_file(:directory?, 'file')
  end

  it "should delegate to File.exist?" do
    delegate_to_file(:exist?, 'file')
  end

  it "should delegate to File.exists?" do
    delegate_to_file(:exists?, 'file')
  end

  it "should delegate to File.file?" do
    delegate_to_file(:file?, 'file')
  end

  it "should delegate to File.readable?" do
    delegate_to_file(:readable?, 'file')
  end

  it "should delegate to File.writable?" do
    delegate_to_file(:writable?, 'file')
  end

  def delegate_to_file(*args)
    method = args.shift
    File.should_receive(method).with(*args).and_return('value')
    FileTest.send(method, *args).should == 'value'
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
torquebox-vfs-1.0.1-java spec/file_test_spec.rb
torquebox-vfs-1.0.0-java spec/file_test_spec.rb
torquebox-vfs-1.0.0.CR2-java spec/file_test_spec.rb
torquebox-vfs-1.0.0.CR1-java spec/file_test_spec.rb
org.torquebox.vfs-1.0.0.Beta23 spec/file_test_spec.rb