SimControl 0.1.5 → 0.1.6

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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- SimControl (0.1.4)
4
+ SimControl (0.1.5)
5
5
  active_support
6
6
  i18n
7
7
  thor
@@ -16,7 +16,7 @@ class SimControl::Hosts
16
16
 
17
17
  def partition(all_scenarios, hostname)
18
18
  return [] if number_of_cores == 0
19
- scenario_groups = all_scenarios.in_groups_of(number_of_cores, false)
19
+ scenario_groups = all_scenarios.in_groups(number_of_cores, false)
20
20
  scenario_groups[host_indices hostname]
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module SimControl
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -40,6 +40,21 @@ describe SimControl::Hosts do
40
40
  expect(host_b_scenarios.first).to include(scenario_d)
41
41
  end
42
42
 
43
+ it "gives all scenarios to one host if only one host with one core exists" do
44
+ hosts = SimControl::Hosts.new
45
+ hosts.use "host-a"
46
+ scenario_a = {foo: 1}
47
+ scenario_b = {foo: 2}
48
+ scenario_c = {foo: 3}
49
+ scenario_d = {foo: 4}
50
+ all_scenarios = [scenario_a, scenario_b, scenario_c, scenario_d]
51
+ host_a_scenarios = hosts.partition all_scenarios, "host-a"
52
+ expect(host_a_scenarios.first).to include(scenario_a)
53
+ expect(host_a_scenarios.first).to include(scenario_b)
54
+ expect(host_a_scenarios.first).to include(scenario_c)
55
+ expect(host_a_scenarios.first).to include(scenario_d)
56
+ end
57
+
43
58
  it "returns the empty list if no hosts exist" do
44
59
  hosts = SimControl::Hosts.new
45
60
  scenario_a = {foo: 1}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SimControl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: