Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
2c5e4955
Commit
2c5e4955
authored
Feb 26, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specs for Gitlab::Popen
parent
9c252a60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
spec/lib/popen_spec.rb
spec/lib/popen_spec.rb
+29
-0
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+6
-2
No files found.
spec/lib/popen_spec.rb
0 → 100644
View file @
2c5e4955
require
'spec_helper'
describe
'Gitlab::Popen'
,
no_db:
true
do
let
(
:path
)
{
Rails
.
root
.
join
(
'tmp'
).
to_s
}
before
do
@klass
=
Class
.
new
(
Object
)
@klass
.
send
(
:include
,
Gitlab
::
Popen
)
end
context
'zero status'
do
before
do
@output
,
@status
=
@klass
.
new
.
popen
(
'ls'
,
path
)
end
it
{
@status
.
should
be_zero
}
it
{
@output
.
should
include
(
'pids'
)
}
end
context
'non-zero status'
do
before
do
@output
,
@status
=
@klass
.
new
.
popen
(
'cat NOTHING'
,
path
)
end
it
{
@status
.
should
==
1
}
it
{
@output
.
should
include
(
'No such file or directory'
)
}
end
end
spec/support/db_cleaner.rb
View file @
2c5e4955
...
...
@@ -9,10 +9,14 @@ RSpec.configure do |config|
DatabaseCleaner
.
strategy
=
:transaction
end
DatabaseCleaner
.
start
unless
example
.
metadata
[
:no_db
]
DatabaseCleaner
.
start
end
end
config
.
after
do
DatabaseCleaner
.
clean
unless
example
.
metadata
[
:no_db
]
DatabaseCleaner
.
clean
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment