diff options
Diffstat (limited to 'spec/lib/gitlab/runtime_spec.rb')
-rw-r--r-- | spec/lib/gitlab/runtime_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb index 181a911c667..fa0fad65520 100644 --- a/spec/lib/gitlab/runtime_spec.rb +++ b/spec/lib/gitlab/runtime_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::Runtime do +RSpec.describe Gitlab::Runtime, feature_category: :application_performance do shared_examples "valid runtime" do |runtime, max_threads| it "identifies itself" do expect(subject.identify).to eq(runtime) @@ -39,9 +39,21 @@ RSpec.describe Gitlab::Runtime do end end + context 'with Puma' do + before do + stub_const('::Puma::Server', double) + end + + describe '.puma?' do + it 'returns true' do + expect(subject.puma?).to be true + end + end + end + context "on multiple matches" do before do - stub_const('::Puma', double) + stub_const('::Puma::Server', double) stub_const('::Rails::Console', double) end @@ -64,6 +76,7 @@ RSpec.describe Gitlab::Runtime do before do stub_const('::Puma', puma_type) + allow(described_class).to receive(:puma?).and_return(true) end it_behaves_like "valid runtime", :puma, 1 + Gitlab::ActionCable::Config.worker_pool_size @@ -75,6 +88,7 @@ RSpec.describe Gitlab::Runtime do before do stub_const('::Puma', puma_type) + allow(described_class).to receive(:puma?).and_return(true) allow(puma_type).to receive_message_chain(:cli_config, :options).and_return(max_threads: 2, workers: max_workers) end |