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
2b90727c
Commit
2b90727c
authored
Jun 23, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change method signature to allow stubbing multiple features
parent
e5f02b4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
spec/support/ee/license_helpers.rb
spec/support/ee/license_helpers.rb
+12
-2
No files found.
spec/support/ee/license_helpers.rb
View file @
2b90727c
module
EE
module
LicenseHelpers
def
stub_feature
(
feature
,
enabled
=
true
)
# Enable/Disable a feature on the License for a spec.
#
# Example:
#
# stub_licensed_features(geo: true, deploy_board: false)
#
# This enables `geo` and disables `deploy_board` features for a spec.
# Other features are still enabled/disabled as defined in the licence.
def
stub_licensed_features
(
features
)
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
feature
)
{
enabled
}
features
.
each
do
|
feature
,
enabled
|
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
feature
)
{
enabled
}
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