Sha256: aef032b9a03247df6e668e29f4d437b4802c073b65faf591cb0268eb308333d5

Contents?: true

Size: 697 Bytes

Versions: 30

Compression:

Stored size: 697 Bytes

Contents

require_relative "../spec_helper"

describe "strip_path_prefix plugin" do 
  it "strips path prefix when expanding paths" do
    app(:bare){}
    abs_dir = app.expand_path('spec')

    app.plugin :strip_path_prefix
    app.expand_path('spec').must_equal 'spec'
    File.expand_path(app.expand_path('spec'), Dir.pwd).must_equal abs_dir

    app.expand_path('/foo').must_equal '/foo'
    app.expand_path('bar', '/foo').must_equal '/foo/bar'

    app.opts[:root] = '/foo'
    app.expand_path('bar').must_equal '/foo/bar'
    app.plugin :strip_path_prefix, '/foo'
    app.expand_path('bar').must_equal 'bar'

    app.opts[:root] = '/foo/bar'
    app.expand_path('baz').must_equal 'bar/baz'
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.27.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.26.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.25.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.24.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.23.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.22.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.21.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.20.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.19.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.18.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.17.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.16.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.15.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.14.1 spec/plugin/strip_path_prefix_spec.rb
roda-3.14.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.13.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.12.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.11.0 spec/plugin/strip_path_prefix_spec.rb
roda-3.10.0 spec/plugin/strip_path_prefix_spec.rb