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
1
Merge Requests
1
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-ce
Commits
394e962e
Commit
394e962e
authored
May 23, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tests of Gitlab::Metrics use explicit descriptions.
parent
ef9f23b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
spec/lib/gitlab/metrics_spec.rb
spec/lib/gitlab/metrics_spec.rb
+24
-10
No files found.
spec/lib/gitlab/metrics_spec.rb
View file @
394e962e
...
...
@@ -9,19 +9,19 @@ describe Gitlab::Metrics do
describe
'.enabled?'
do
it
'returns a boolean'
do
expect
(
[
true
,
false
].
include?
(
described_class
.
enabled?
)).
to
eq
(
true
)
expect
(
described_class
.
enabled?
).
to
be_in
([
true
,
false
]
)
end
end
describe
'.prometheus_metrics_enabled?'
do
it
'returns a boolean'
do
expect
(
[
true
,
false
].
include?
(
described_class
.
prometheus_metrics_enabled?
)).
to
eq
(
true
)
expect
(
described_class
.
prometheus_metrics_enabled?
).
to
be_in
([
true
,
false
]
)
end
end
describe
'.influx_metrics_enabled?'
do
it
'returns a boolean'
do
expect
(
[
true
,
false
].
include?
(
described_class
.
influx_metrics_enabled?
)).
to
eq
(
true
)
expect
(
described_class
.
influx_metrics_enabled?
).
to
be_in
([
true
,
false
]
)
end
end
...
...
@@ -195,9 +195,17 @@ describe Gitlab::Metrics do
subject
{
described_class
.
counter
(
:couter
,
'doc'
)
}
describe
'#increment'
do
it
{
expect
{
subject
.
increment
}.
not_to
raise_exception
}
it
{
expect
{
subject
.
increment
({})
}.
not_to
raise_exception
}
it
{
expect
{
subject
.
increment
({},
1
)
}.
not_to
raise_exception
}
it
'successfully calls #increment without arguments'
do
expect
{
subject
.
increment
}.
not_to
raise_exception
end
it
'successfully calls #increment with 1 argument'
do
expect
{
subject
.
increment
({})
}.
not_to
raise_exception
end
it
'successfully calls #increment with 2 arguments'
do
expect
{
subject
.
increment
({},
1
)
}.
not_to
raise_exception
end
end
end
...
...
@@ -205,15 +213,19 @@ describe Gitlab::Metrics do
subject
{
described_class
.
summary
(
:summary
,
'doc'
)
}
describe
'#observe'
do
it
{
expect
{
subject
.
observe
({},
2
)
}.
not_to
raise_exception
}
it
'successfully calls #observe with 2 arguments'
do
expect
{
subject
.
observe
({},
2
)
}.
not_to
raise_exception
end
end
end
describe
'#gauge'
do
subject
{
described_class
.
gauge
(
:gauge
,
'doc'
)
}
describe
'#observe'
do
it
{
expect
{
subject
.
set
({},
1
)
}.
not_to
raise_exception
}
describe
'#set'
do
it
'successfully calls #set with 2 arguments'
do
expect
{
subject
.
set
({},
1
)
}.
not_to
raise_exception
end
end
end
...
...
@@ -221,7 +233,9 @@ describe Gitlab::Metrics do
subject
{
described_class
.
histogram
(
:histogram
,
'doc'
)
}
describe
'#observe'
do
it
{
expect
{
subject
.
observe
({},
2
)
}.
not_to
raise_exception
}
it
'successfully calls #observe with 2 arguments'
do
expect
{
subject
.
observe
({},
2
)
}.
not_to
raise_exception
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