Sha256: b4f2572e34148a0865fcf8dbcfeff670e4d6a4dd6c1d23ac1ca673dbfcf3a83a

Contents?: true

Size: 1.01 KB

Versions: 19

Compression:

Stored size: 1.01 KB

Contents

describe Bluepill::System do
  describe :pid_alive? do
    it "should be true if process responds to zero signal" do
      mock(::Process).kill(0, 555)
      Bluepill::System.should be_pid_alive(555)
    end

    it "should be false if process throws exception on zero signal" do
      mock(::Process).kill(0, 555) { raise Errno::ESRCH.new  }
      Bluepill::System.should_not be_pid_alive(555)
    end
  end

  describe :store do
    it "should be Hash" do
      Bluepill::System.store.should be_kind_of(Hash)
    end

    it "should return same Hash or every call" do
      Bluepill::System.store.should be_equal(Bluepill::System.store) 
    end

    it "should store assigned pairs" do
      Bluepill::System.store[:somekey] = 10
      Bluepill::System.store[:somekey].should be_eql(10) 
    end
  end

  describe :reset_data do
    it 'should clear the #store' do
      Bluepill::System.store[:anotherkey] = Faker::Lorem.sentence
      Bluepill::System.reset_data
      Bluepill::System.store.should be_empty
    end
  end
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
bluepill-rwgps-0.0.63 spec/lib/bluepill/system_spec.rb
bluepill-rwgps-0.0.62 spec/lib/bluepill/system_spec.rb
bluepill-rwgps-0.0.61 spec/lib/bluepill/system_spec.rb
bluepill-rwgps-0.0.60 spec/lib/bluepill/system_spec.rb
bluepill-0.0.62 spec/lib/bluepill/system_spec.rb
bluepill-0.0.61 spec/lib/bluepill/system_spec.rb
kostya-bluepill-0.0.60.3 spec/lib/bluepill/system_spec.rb
kostya-bluepill-0.0.60.2 spec/lib/bluepill/system_spec.rb
kostya-bluepill-0.0.60.1 spec/lib/bluepill/system_spec.rb
skalar-bluepill-0.0.60.1 spec/lib/bluepill/system_spec.rb
bluepill-0.0.60 spec/lib/bluepill/system_spec.rb
bluepill-0.0.59 spec/lib/bluepill/system_spec.rb
bluepill-0.0.58 spec/lib/bluepill/system_spec.rb
bluepill-0.0.57 spec/lib/bluepill/system_spec.rb
bluepill-0.0.56 spec/lib/bluepill/system_spec.rb
bluepill-0.0.55 spec/lib/bluepill/system_spec.rb
bluepill-0.0.54 spec/lib/bluepill/system_spec.rb
bluepill-0.0.53 spec/lib/bluepill/system_spec.rb
bluepill-0.0.52 spec/lib/bluepill/system_spec.rb