Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
nexedi
gitlab-shell
Commits
d7e1deb1
Commit
d7e1deb1
authored
Nov 25, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub file writing in tests
parent
559196cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
spec/gitlab_keys_spec.rb
spec/gitlab_keys_spec.rb
+11
-6
No files found.
spec/gitlab_keys_spec.rb
View file @
d7e1deb1
...
@@ -53,6 +53,9 @@ describe GitlabKeys do
...
@@ -53,6 +53,9 @@ describe GitlabKeys do
File
.
read
(
tmp_authorized_keys_path
).
should
==
"existing content
\n
#{
other_line
}
\n
"
File
.
read
(
tmp_authorized_keys_path
).
should
==
"existing content
\n
#{
other_line
}
\n
"
end
end
context
"without file writing"
do
before
{
Tempfile
.
stub
(
:open
)
}
it
"should log an rm-key event"
do
it
"should log an rm-key event"
do
$logger
.
should_receive
(
:info
).
with
(
'Removing key key-741'
)
$logger
.
should_receive
(
:info
).
with
(
'Removing key key-741'
)
gitlab_keys
.
send
:rm_key
gitlab_keys
.
send
:rm_key
...
@@ -62,11 +65,13 @@ describe GitlabKeys do
...
@@ -62,11 +65,13 @@ describe GitlabKeys do
gitlab_keys
.
send
(
:rm_key
).
should
be_true
gitlab_keys
.
send
(
:rm_key
).
should
be_true
end
end
end
end
end
describe
:clear
do
describe
:clear
do
let
(
:gitlab_keys
)
{
build_gitlab_keys
(
'clear'
)
}
let
(
:gitlab_keys
)
{
build_gitlab_keys
(
'clear'
)
}
it
"should return true"
do
it
"should return true"
do
gitlab_keys
.
stub
(
:open
)
gitlab_keys
.
send
(
:clear
).
should
be_true
gitlab_keys
.
send
(
:clear
).
should
be_true
end
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