Sha256: b472473e2cbcbba5875f02852b9dc7cac5bdcb0bfd8501139e91e41f6ce5f689
Contents?: true
Size: 995 Bytes
Versions: 49
Compression:
Stored size: 995 Bytes
Contents
# frozen_string_literal: true require File.expand_path("../../test_helper", File.dirname(__FILE__)) class RackServerCheckTest < Minitest::Test test "returns true when running in rack server" do caller_locations = ["blah/lib/rack/server.rb"].map { |path| OpenStruct.new(path: path, label: "foo") } Kernel.expects(:caller_locations).returns(caller_locations) assert(Coverband::RackServerCheck.running?) end test "returns false when not running in rack server" do caller_locations = ["blah/lib/sidekiq/worker.rb"].map { |path| OpenStruct.new(path: path, label: "foo") } Kernel.expects(:caller_locations).returns(caller_locations) refute(Coverband::RackServerCheck.running?) end test "returns true if running within a rails server" do caller_locations = [OpenStruct.new(path: "/lib/rails/commands/commands_tasks.rb", label: "server")] Kernel.expects(:caller_locations).returns(caller_locations) assert(Coverband::RackServerCheck.running?) end end
Version data entries
49 entries across 49 versions & 1 rubygems