Sha256: 7dee0569d6887e630adda6599e5081a0f3dcc689e36fb4c91c303acd23c5f6f2
Contents?: true
Size: 773 Bytes
Versions: 52
Compression:
Stored size: 773 Bytes
Contents
require File.expand_path('../../../../spec_helper', __FILE__) describe "File::Stat#initialize" do before :each do @file = tmp('i_exist') touch(@file) { |f| f.write "rubinius" } File.chmod(0755, @file) end after :each do rm_r @file end it "raises an exception if the file doesn't exist" do lambda { File::Stat.new(tmp("i_am_a_dummy_file_that_doesnt_exist")) }.should raise_error end it "creates a File::Stat object for the given file" do st = File::Stat.new(@file) st.should be_kind_of(File::Stat) st.ftype.should == 'file' end ruby_version_is "1.9" do it "calls #to_path on non-String arguments" do p = mock('path') p.should_receive(:to_path).and_return @file File::Stat.new p end end end
Version data entries
52 entries across 52 versions & 2 rubygems