Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2015-12-19 11:31:52 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-14 14:48:13 +0300
commit518b206287318006f9b57382a747b1474b6795a4 (patch)
tree010b3b7f59798770288b574cfce3a285dbc0b93e /spec
parent80a71576ba27d84b3406a8b929328359e2edc9da (diff)
Add `parent` iteration implementation to `StringPath`
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/string_path_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/string_path_spec.rb b/spec/lib/gitlab/string_path_spec.rb
index 6e75e1f3ced..86e48f6ee0b 100644
--- a/spec/lib/gitlab/string_path_spec.rb
+++ b/spec/lib/gitlab/string_path_spec.rb
@@ -19,6 +19,7 @@ describe Gitlab::StringPath do
it { is_expected.to be_absolute }
it { is_expected.to_not be_relative }
it { is_expected.to be_file }
+ it { is_expected.to_not have_parent }
describe '#basename' do
subject { described_class.new('/file/with/absolute_path', universe).basename }
@@ -32,9 +33,13 @@ describe Gitlab::StringPath do
it { is_expected.to be_directory }
it { is_expected.to be_relative }
+ it { is_expected.to_not have_parent }
end
describe 'path/dir_1/' do
+ subject { described_class.new('path/dir_1/', universe) }
+ it { is_expected.to have_parent }
+
describe '#files' do
subject { described_class.new('path/dir_1/', universe).files }
@@ -45,8 +50,12 @@ describe Gitlab::StringPath do
describe '#basename' do
subject { described_class.new('path/dir_1/', universe).basename }
-
it { is_expected.to eq 'dir_1/' }
end
+
+ describe '#parent' do
+ subject { described_class.new('path/dir_1/', universe).parent }
+ it { is_expected.to eq Gitlab::StringPath.new('path/', universe) }
+ end
end
end