diff options
author | Stan Hu <stanhu@gmail.com> | 2018-11-27 15:07:56 -0800 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-12-12 13:25:55 +1100 |
commit | 7f931ae0ed720106a3b87fc79191b1feecb00519 (patch) | |
tree | 74e814b8504af74319352965a4efe302403d1b3a | |
parent | a4c807f40ef6c2059c4811d368e0ca31f8381e58 (diff) | |
download | gitlab-shell-7f931ae0ed720106a3b87fc79191b1feecb00519.tar.gz |
Fix gitlab_keys_spec for File.open changes
-rw-r--r-- | spec/gitlab_keys_spec.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/gitlab_keys_spec.rb b/spec/gitlab_keys_spec.rb index f86d00d..67a8770 100644 --- a/spec/gitlab_keys_spec.rb +++ b/spec/gitlab_keys_spec.rb @@ -148,7 +148,9 @@ describe GitlabKeys do context "without file writing" do before do - expect(gitlab_keys).to receive(:open).and_yield(double(:file, puts: nil, chmod: nil)) + file = double(:file, puts: nil, chmod: nil, flock: nil) + expect(File).to receive(:open).with(tmp_authorized_keys_path + '.lock', 'w+').and_yield(file) + expect(File).to receive(:open).with(tmp_authorized_keys_path, "a", 0o600).and_yield(file) end it "should log an add-key event" do |