Sha256: 5703f52d243728fdb50b2e2c28981d1294d598b2ea0132321920215eea08913e

Contents?: true

Size: 574 Bytes

Versions: 10

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'
require 'ronin/extensions/file'

describe File do
  subject { File }

  it "should provide File.escape_path" do
    subject.should respond_to(:escape_path)
  end

  describe "escape_path" do
    it "should remove null-bytes" do
      File.escape_path("hello\0world\0").should == "helloworld"
    end

    it "should escape home-dir expansions" do
      File.escape_path("hello/~world").should == "hello/\\~world"
    end

    it "should remove '.' and '..' directories" do
      File.escape_path("hello/./../world").should == "world"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ronin-support-0.2.0 spec/extensions/file_spec.rb
ronin-support-0.2.0.rc2 spec/extensions/file_spec.rb
ronin-support-0.2.0.rc1 spec/extensions/file_spec.rb
ronin-support-0.1.0 spec/extensions/file_spec.rb
ronin-support-0.1.0.rc3 spec/extensions/file_spec.rb
ronin-support-0.1.0.rc2 spec/extensions/file_spec.rb
ronin-support-0.1.0.rc1 spec/extensions/file_spec.rb
ronin-support-0.1.0.pre3 spec/extensions/file_spec.rb
ronin-support-0.1.0.pre2 spec/extensions/file_spec.rb
ronin-support-0.1.0.pre1 spec/extensions/file_spec.rb