Sha256: 713c5beb1fa07f3f30eedd4e108a308043e97472d79e9b46d2ada3cd7e13cc09

Contents?: true

Size: 572 Bytes

Versions: 9

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require './lib/fusuma/custom_process'

module Fusuma
  RSpec.describe CustomProcess do
    class ForkTest
      include CustomProcess

      def call
        fork { puts 'hoge' }
      end
    end

    describe '.fork' do
      before do
        allow(Process).to receive(:fork)
      end
      it 'call Process.fork and Process.setproctitle' do
        expect(Process).to receive(:fork).and_yield do
          expect(Process).to receive(:setproctitle)
        end
        ForkTest.new.call
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fusuma-2.4.0 spec/lib/custom_process_spec.rb
fusuma-2.3.0 spec/lib/custom_process_spec.rb
fusuma-2.2.0 spec/lib/custom_process_spec.rb
fusuma-2.1.0 spec/lib/custom_process_spec.rb
fusuma-2.0.5 spec/lib/custom_process_spec.rb
fusuma-2.0.4 spec/lib/custom_process_spec.rb
fusuma-2.0.3 spec/lib/custom_process_spec.rb
fusuma-2.0.2 spec/lib/custom_process_spec.rb
fusuma-2.0.1 spec/lib/custom_process_spec.rb