Sha256: ff05afcacc56c17bc9c777f1855178254f95c674e93accc3d870bcf5ee0c2ed6
Contents?: true
Size: 1.07 KB
Versions: 3
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper.rb' describe SyntaxFix::DirFile do before(:all) do @path = "#{File.expand_path('.')}/spec/fixtures" end it "checks if current item is a dir" do dir = SyntaxFix::DirFile.new("#{@path}/nested") dir.is_dir?.should be_true end it "returns false when dir is '..'" do dir = SyntaxFix::DirFile.new("#{@path}/nested/.") dir.is_dir?.should be_false end it "doesn't read files with dat extension" do not_correct = SyntaxFix::DirFile.new("#{@path}/not_rb.dat") not_correct.correct_file?.should be_false end it "reads files with rb extension" do correct = SyntaxFix::DirFile.new("#{@path}/test.rb") correct.correct_file?.should be_true end it "reads the given file" do dir = SyntaxFix::DirFile.new("#{@path}/nested/nested.rb") dir.read_file.should == 'nested.rb' end it "puts given source into a file" do path = "#{@path}/nested/not_rb.txt" File.truncate(path, 0) file = SyntaxFix::DirFile.new(path) file.write_file('not_rb.txt') file.read_file.should == 'not_rb.txt' end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
syntax_fix-0.0.3 | spec/specs/dir_file_spec.rb |
syntax_fix-0.0.2 | spec/specs/dir_file_spec.rb |
syntax_fix-0.0.1 | spec/specs/dir_file_spec.rb |