litmus_paper 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,8 @@ module LitmusPaper
13
13
 
14
14
  Timeout.timeout(@timeout) do
15
15
  socket = TCPSocket.new(@ip, @port)
16
- if @input_data || @expected_output
17
- socket.puts(@input_data.to_s)
16
+ if @expected_output
17
+ socket.puts(@input_data) if @input_data
18
18
  data = socket.gets
19
19
  response = data.chomp == @expected_output
20
20
  LitmusPaper.logger.info("Response (#{response}) does not match expected output (#{@expected_output})")
@@ -7,7 +7,7 @@ module LitmusPaper
7
7
  end
8
8
 
9
9
  def current_health
10
- [@weight - (@weight * load_average / processor_count), 0].max
10
+ [@weight - (@weight * load_average / processor_count), 1].max
11
11
  end
12
12
 
13
13
  def processor_count
@@ -1,3 +1,3 @@
1
1
  module LitmusPaper
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -8,10 +8,10 @@ describe LitmusPaper::Metric::CPULoad do
8
8
  cpu_load.current_health.should == 30
9
9
  end
10
10
 
11
- it "is zero when the load is above one per core" do
11
+ it "is one when the load is above one per core" do
12
12
  facter = StubFacter.new({"processorcount" => "4", "loadaverage" => "20.00 11.40 10.00"})
13
13
  cpu_load = LitmusPaper::Metric::CPULoad.new(50, facter)
14
- cpu_load.current_health.should == 0
14
+ cpu_load.current_health.should == 1
15
15
  end
16
16
  end
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litmus_paper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-11 00:00:00.000000000 Z
12
+ date: 2015-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra