Sha256: 83f58f85577df6a74581d7b82102fb13c8dfb1b25bcf7e5ab7cc0a18c446ccd0

Contents?: true

Size: 725 Bytes

Versions: 17

Compression:

Stored size: 725 Bytes

Contents

describe WatirSplash::Util do

  before :all do
    @file_name = "blah.temp"
    @ext = File.extname(@file_name)
    @base = File.basename(@file_name, @ext)
  end

  it ".file_path returns unique file path" do
    expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}")
    WatirSplash::Util.file_path(@file_name).should =~ Regexp.new(expected_path)
  end

  it ".file_native_path returns unique file path with native path separator" do
    expected_path = File.join(Dir.pwd, "results/files/#{@base}_.*#{@ext}").gsub("/", "\\")
    WatirSplash::Util.file_native_path(WatirSplash::Util.file_path(@file_name)).should =~ Regexp.new(Regexp.escape(expected_path).gsub("\\.\\*", ".*"))
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
watirsplash-2.4.4 spec/util_spec.rb
watirsplash-2.4.3 spec/util_spec.rb
watirsplash-2.4.2 spec/util_spec.rb
watirsplash-2.4.1 spec/util_spec.rb
watirsplash-2.4.0 spec/util_spec.rb
watirsplash-2.3.2 spec/util_spec.rb
watirsplash-2.3.1 spec/util_spec.rb
watirsplash-2.3.0 spec/util_spec.rb
watirsplash-2.2.0 spec/util_spec.rb
watirsplash-2.1.1 spec/util_spec.rb
watirsplash-2.1.0 spec/util_spec.rb
watirsplash-2.0.1.rc5 spec/util_spec.rb
watirsplash-2.0.1.rc4 spec/util_spec.rb
watirsplash-2.0.1.rc3 spec/util_spec.rb
watirsplash-2.0.1.rc1 spec/util_spec.rb
watirsplash-2.0.0 spec/util_spec.rb
watirsplash-2.0.0.rc2 spec/util_spec.rb