Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 12:07:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 12:07:51 +0300
commit914ea32e0efca21436220df2c10e1bfbe4ed3da9 (patch)
treee8eb3b97aea2006bd863c586b7ec41d51f654b3b /spec/lib/gitlab/daemon_spec.rb
parent3546e1bb0971347e9e9984de0799e3fb53743b33 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/daemon_spec.rb')
-rw-r--r--spec/lib/gitlab/daemon_spec.rb26
1 files changed, 20 insertions, 6 deletions
diff --git a/spec/lib/gitlab/daemon_spec.rb b/spec/lib/gitlab/daemon_spec.rb
index 0372b770844..cf1f089c577 100644
--- a/spec/lib/gitlab/daemon_spec.rb
+++ b/spec/lib/gitlab/daemon_spec.rb
@@ -6,7 +6,7 @@ describe Gitlab::Daemon do
subject { described_class.new }
before do
- allow(subject).to receive(:start_working)
+ allow(subject).to receive(:run_thread)
allow(subject).to receive(:stop_working)
end
@@ -44,7 +44,7 @@ describe Gitlab::Daemon do
it 'starts the Daemon' do
expect { subject.start.join }.to change { subject.thread? }.from(false).to(true)
- expect(subject).to have_received(:start_working)
+ expect(subject).to have_received(:run_thread)
end
end
@@ -52,7 +52,21 @@ describe Gitlab::Daemon do
it "doesn't shutdown stopped Daemon" do
expect { subject.stop }.not_to change { subject.thread? }
- expect(subject).not_to have_received(:start_working)
+ expect(subject).not_to have_received(:run_thread)
+ end
+ end
+ end
+
+ describe '#start_working' do
+ context 'when start_working fails' do
+ before do
+ expect(subject).to receive(:start_working) { false }
+ end
+
+ it 'does not start thread' do
+ expect(subject).not_to receive(:run_thread)
+
+ expect(subject.start).to eq(nil)
end
end
end
@@ -66,7 +80,7 @@ describe Gitlab::Daemon do
it "doesn't start running Daemon" do
expect { subject.start.join }.not_to change { subject.thread }
- expect(subject).to have_received(:start_working).once
+ expect(subject).to have_received(:run_thread).once
end
end
@@ -79,7 +93,7 @@ describe Gitlab::Daemon do
context 'when stop_working raises exception' do
before do
- allow(subject).to receive(:start_working) do
+ allow(subject).to receive(:run_thread) do
sleep(1000)
end
end
@@ -108,7 +122,7 @@ describe Gitlab::Daemon do
expect(subject.start).to be_nil
expect { subject.start }.not_to change { subject.thread? }
- expect(subject).not_to have_received(:start_working)
+ expect(subject).not_to have_received(:run_thread)
end
end