Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8394331
create_repo_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
create_repo_spec.rb
View Options
require
'spec_helper_acceptance'
tmpdir
=
default
.
tmpdir
(
'vcsrepo'
)
describe
'create a repo'
do
context
'without a source'
do
it
'creates a blank repo'
do
pp
=
<<-
EOS
vcsrepo { "#{tmpdir}/testrepo_blank_repo":
ensure => present,
provider => git,
}
EOS
# Run it twice and test for idempotency
apply_manifest
(
pp
,
:catch_failures
=>
true
)
apply_manifest
(
pp
,
:catch_changes
=>
true
)
end
describe
file
(
"
#{
tmpdir
}
/testrepo_blank_repo/"
)
do
it
'should have zero files'
do
shell
(
"ls -1
#{
tmpdir
}
/testrepo_blank_repo | wc -l"
)
do
|
r
|
expect
(
r
.
stdout
)
.
to
match
(
/^0\n$/
)
end
end
end
describe
file
(
"
#{
tmpdir
}
/testrepo_blank_repo/.git"
)
do
it
{
is_expected
.
to
be_directory
}
end
end
context
'no source but revision provided'
do
it
'should not fail (MODULES-2125)'
do
pp
=
<<-
EOS
vcsrepo { "#{tmpdir}/testrepo_blank_with_revision_repo":
ensure => present,
provider => git,
revision => 'master'
}
EOS
# Run it twice and test for idempotency
apply_manifest
(
pp
,
:catch_failures
=>
true
)
apply_manifest
(
pp
,
:catch_changes
=>
true
)
end
end
context
'bare repo'
do
it
'creates a bare repo'
do
pp
=
<<-
EOS
vcsrepo { "#{tmpdir}/testrepo_bare_repo":
ensure => bare,
provider => git,
}
EOS
# Run it twice and test for idempotency
apply_manifest
(
pp
,
:catch_failures
=>
true
)
apply_manifest
(
pp
,
:catch_changes
=>
true
)
end
describe
file
(
"
#{
tmpdir
}
/testrepo_bare_repo/config"
)
do
it
{
is_expected
.
to
contain
'bare = true'
}
end
describe
file
(
"
#{
tmpdir
}
/testrepo_bare_repo/.git"
)
do
it
{
is_expected
.
not_to
be_directory
}
end
end
context
'bare repo with a revision'
do
it
'does not create a bare repo when a revision is defined'
do
pp
=
<<-
EOS
vcsrepo { "#{tmpdir}/testrepo_bare_repo_rev":
ensure => bare,
provider => git,
revision => 'master',
}
EOS
apply_manifest
(
pp
,
:expect_failures
=>
true
)
end
describe
file
(
"
#{
tmpdir
}
/testrepo_bare_repo_rev"
)
do
it
{
is_expected
.
not_to
be_directory
}
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Wed, Jun 4, 7:23 PM (4 d, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3399130
Attached To
R119 Support for source control repositories
Event Timeline
Log In to Comment