mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 16:16:43 +10:00
`StringPath` class is something similar to Ruby's `Pathname` class, but does not involve any IO operations. `StringPath` objects require passing string representation of path, and array of paths that represents universe to constructor to be intantiated.
22 lines
520 B
Ruby
22 lines
520 B
Ruby
require 'spec_helper'
|
|
|
|
describe Gitlab::StringPath do
|
|
let(:universe) do
|
|
['path/dir_1/',
|
|
'path/dir_1/file_1',
|
|
'path/second_dir',
|
|
'path/second_dir/dir_3/file_2',
|
|
'path/second_dir/dir_3/file_3',
|
|
'another_file',
|
|
'/file/with/absolute_path']
|
|
end
|
|
|
|
describe '/file/with/absolute_path' do
|
|
subject { described_class.new('/file/with/absolute_path', universe) }
|
|
|
|
it { is_expected.to be_absolute }
|
|
it { is_expected.to_not be_relative }
|
|
it { is_expected.to be_file }
|
|
end
|
|
end
|