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
98e3fec5
Commit
98e3fec5
authored
Aug 28, 2021
by
Baodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor database task dir for spec
Use 'DatabaseTasks.db_dir' to adapt user's configuration
parent
a149b49d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
spec/tasks/gitlab/db_rake_spec.rb
spec/tasks/gitlab/db_rake_spec.rb
+4
-3
No files found.
spec/tasks/gitlab/db_rake_spec.rb
View file @
98e3fec5
...
...
@@ -129,13 +129,14 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do
let
(
:output
)
{
StringIO
.
new
}
before
do
structure_files
=
%w[
db/structure.sql db/
ci_structure.sql]
structure_files
=
%w[
structure.sql
ci_structure.sql]
allow
(
File
).
to
receive
(
:open
).
and_call_original
structure_files
.
each
do
|
structure_file
|
structure_files
.
each
do
|
structure_file_name
|
structure_file
=
File
.
join
(
ActiveRecord
::
Tasks
::
DatabaseTasks
.
db_dir
,
structure_file_name
)
stub_file_read
(
structure_file
,
content:
input
)
allow
(
File
).
to
receive
(
:open
).
with
(
Rails
.
root
.
join
(
structure_file
)
.
to_s
,
any_args
).
and_yield
(
output
)
allow
(
File
).
to
receive
(
:open
).
with
(
structure_file
.
to_s
,
any_args
).
and_yield
(
output
)
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