Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit 576a2f1

Browse files
committed
Add tests for nested submodules
1 parent 0ddf2ec commit 576a2f1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

spec/repository_spec.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160

161161
context :submodules do
162162
let(:repository) { Gitlab::Git::Repository.new(TEST_REPO_PATH) }
163-
let(:submodules) { repository.submodules(SeedRepo::Commit::ID) }
163+
let(:submodules) { repository.submodules('master') }
164164

165165
it { submodules.should be_kind_of Hash }
166166
it { submodules.empty?.should be_false }
@@ -177,6 +177,20 @@
177177
}
178178
]
179179
end
180+
181+
it 'should handle nested submodules correctly' do
182+
nested = submodules['nested/six']
183+
expect(nested['path']).to eq('nested/six')
184+
expect(nested['url']).to eq('git://github.com/randx/six.git')
185+
expect(nested['id']).to eq('24fb71c79fcabc63dfd8832b12ee3bf2bf06b196')
186+
end
187+
188+
it 'should handle deeply nested submodules correctly' do
189+
nested = submodules['deeper/nested/six']
190+
expect(nested['path']).to eq('deeper/nested/six')
191+
expect(nested['url']).to eq('git://github.com/randx/six.git')
192+
expect(nested['id']).to eq('24fb71c79fcabc63dfd8832b12ee3bf2bf06b196')
193+
end
180194
end
181195
end
182196

0 commit comments

Comments
 (0)