Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c66bcf34
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c66bcf34
编写于
7月 07, 2016
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add comment with diff to DiffPositionUpdateService spec
上级
14c2b968
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
104 addition
and
0 deletion
+104
-0
spec/services/notes/diff_position_update_service_spec.rb
spec/services/notes/diff_position_update_service_spec.rb
+104
-0
未找到文件。
spec/services/notes/diff_position_update_service_spec.rb
浏览文件 @
c66bcf34
...
...
@@ -32,6 +32,110 @@ describe Notes::DiffPositionUpdateService, services: true do
)
end
# old diff:
# 1 + require 'fileutils'
# 2 + require 'open3'
# 3 +
# 4 + module Popen
# 5 + extend self
# 6 +
# 7 + def popen(cmd, path=nil)
# 8 + unless cmd.is_a?(Array)
# 9 + raise "System commands must be given as an array of strings"
# 10 + end
# 11 +
# 12 + path ||= Dir.pwd
# 13 + vars = { "PWD" => path }
# 14 + options = { chdir: path }
# 15 +
# 16 + unless File.directory?(path)
# 17 + FileUtils.mkdir_p(path)
# 18 + end
# 19 +
# 20 + @cmd_output = ""
# 21 + @cmd_status = 0
# 22 + Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
# 23 + @cmd_output << stdout.read
# 24 + @cmd_output << stderr.read
# 25 + @cmd_status = wait_thr.value.exitstatus
# 26 + end
# 27 +
# 28 + return @cmd_output, @cmd_status
# 29 + end
# 30 + end
#
# new diff:
# 1 + require 'fileutils'
# 2 + require 'open3'
# 3 +
# 4 + module Popen
# 5 + extend self
# 6 +
# 7 + def popen(cmd, path=nil)
# 8 + unless cmd.is_a?(Array)
# 9 + raise RuntimeError, "System commands must be given as an array of strings"
# 10 + end
# 11 +
# 12 + path ||= Dir.pwd
# 13 +
# 14 + vars = {
# 15 + "PWD" => path
# 16 + }
# 17 +
# 18 + options = {
# 19 + chdir: path
# 20 + }
# 21 +
# 22 + unless File.directory?(path)
# 23 + FileUtils.mkdir_p(path)
# 24 + end
# 25 +
# 26 + @cmd_output = ""
# 27 + @cmd_status = 0
# 28 +
# 29 + Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
# 30 + @cmd_output << stdout.read
# 31 + @cmd_output << stderr.read
# 32 + @cmd_status = wait_thr.value.exitstatus
# 33 + end
# 34 +
# 35 + return @cmd_output, @cmd_status
# 36 + end
# 37 + end
#
# old->new diff:
# .. .. @@ -6,12 +6,18 @@ module Popen
# 6 6
# 7 7 def popen(cmd, path=nil)
# 8 8 unless cmd.is_a?(Array)
# 9 - raise "System commands must be given as an array of strings"
# 9 + raise RuntimeError, "System commands must be given as an array of strings"
# 10 10 end
# 11 11
# 12 12 path ||= Dir.pwd
# 13 - vars = { "PWD" => path }
# 14 - options = { chdir: path }
# 13 +
# 14 + vars = {
# 15 + "PWD" => path
# 16 + }
# 17 +
# 18 + options = {
# 19 + chdir: path
# 20 + }
# 15 21
# 16 22 unless File.directory?(path)
# 17 23 FileUtils.mkdir_p(path)
# 18 24 end
# 19 25
# 20 26 @cmd_output = ""
# 21 27 @cmd_status = 0
# 28 +
# 22 29 Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
# 23 30 @cmd_output << stdout.read
# 24 31 @cmd_output << stderr.read
# .. ..
describe
"#execute"
do
let
(
:note
)
{
create
(
:diff_note_on_merge_request
,
project:
project
,
position:
old_position
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录