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
32147ddf
Commit
32147ddf
authored
Sep 07, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for "end condition happens before start condition".
- In the cycle analytics specs.
parent
9cff3f8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
spec/support/cycle_analytics_helpers.rb
spec/support/cycle_analytics_helpers.rb
+21
-0
No files found.
spec/support/cycle_analytics_helpers.rb
View file @
32147ddf
...
@@ -80,6 +80,27 @@ module CycleAnalyticsHelpers
...
@@ -80,6 +80,27 @@ module CycleAnalyticsHelpers
expect
(
subject
.
send
(
phase
)).
to
be_nil
expect
(
subject
.
send
(
phase
)).
to
be_nil
end
end
end
end
context
"when the end condition happens before the start condition"
do
it
'returns nil'
do
data
=
data_fn
[
self
]
start_time
=
Time
.
now
end_time
=
start_time
+
rand
(
1
..
5
).
days
# Run `before_end_fn` at the midpoint between `start_time` and `end_time`
Timecop
.
freeze
(
start_time
+
(
end_time
-
start_time
)
/
2
)
{
before_end_fn
[
self
,
data
]
}
if
before_end_fn
end_time_conditions
.
each
do
|
condition_name
,
condition_fn
|
Timecop
.
freeze
(
start_time
)
{
condition_fn
[
self
,
data
]
}
end
start_time_conditions
.
each
do
|
condition_name
,
condition_fn
|
Timecop
.
freeze
(
end_time
)
{
condition_fn
[
self
,
data
]
}
end
expect
(
subject
.
send
(
phase
)).
to
be_nil
end
end
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