test-kitchen 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +5 -5
  2. data/.gitattributes +0 -0
  3. data/.github/ISSUE_TEMPLATE.md +0 -0
  4. data/.gitignore +0 -0
  5. data/.kitchen.ci.yml +0 -0
  6. data/.kitchen.dokken.yml +0 -0
  7. data/.kitchen.proxy.yml +1 -1
  8. data/.rubocop.yml +1 -1
  9. data/.travis.yml +6 -2
  10. data/.yardopts +0 -0
  11. data/Berksfile +0 -0
  12. data/CHANGELOG.md +26 -0
  13. data/CONTRIBUTING.md +0 -0
  14. data/ECOSYSTEM.md +0 -0
  15. data/Gemfile +6 -2
  16. data/Gemfile.proxy_tests +0 -0
  17. data/Guardfile +0 -0
  18. data/LICENSE +0 -0
  19. data/MAINTAINERS.md +0 -0
  20. data/README.md +0 -0
  21. data/Rakefile +0 -0
  22. data/appveyor.yml +4 -3
  23. data/features/kitchen_action_commands.feature +0 -0
  24. data/features/kitchen_command.feature +0 -0
  25. data/features/kitchen_console_command.feature +0 -0
  26. data/features/kitchen_defaults.feature +2 -2
  27. data/features/kitchen_diagnose_command.feature +0 -0
  28. data/features/kitchen_help_command.feature +0 -0
  29. data/features/kitchen_init_command.feature +19 -39
  30. data/features/kitchen_list_command.feature +3 -3
  31. data/features/kitchen_login_command.feature +0 -0
  32. data/features/kitchen_sink_command.feature +0 -0
  33. data/features/kitchen_test_command.feature +0 -0
  34. data/features/step_definitions/gem_steps.rb +0 -12
  35. data/features/step_definitions/git_steps.rb +0 -0
  36. data/features/step_definitions/output_steps.rb +0 -0
  37. data/features/support/env.rb +0 -0
  38. data/lib/kitchen.rb +0 -0
  39. data/lib/kitchen/base64_stream.rb +0 -0
  40. data/lib/kitchen/cli.rb +15 -11
  41. data/lib/kitchen/collection.rb +0 -0
  42. data/lib/kitchen/color.rb +0 -0
  43. data/lib/kitchen/command.rb +1 -1
  44. data/lib/kitchen/command/action.rb +0 -0
  45. data/lib/kitchen/command/console.rb +0 -0
  46. data/lib/kitchen/command/diagnose.rb +0 -0
  47. data/lib/kitchen/command/doctor.rb +0 -0
  48. data/lib/kitchen/command/exec.rb +0 -0
  49. data/lib/kitchen/command/list.rb +0 -0
  50. data/lib/kitchen/command/login.rb +0 -0
  51. data/lib/kitchen/command/package.rb +0 -0
  52. data/lib/kitchen/command/sink.rb +0 -0
  53. data/lib/kitchen/command/test.rb +0 -0
  54. data/lib/kitchen/config.rb +1 -1
  55. data/lib/kitchen/configurable.rb +0 -0
  56. data/lib/kitchen/data_munger.rb +10 -10
  57. data/lib/kitchen/diagnostic.rb +0 -0
  58. data/lib/kitchen/driver.rb +0 -0
  59. data/lib/kitchen/driver/base.rb +0 -0
  60. data/lib/kitchen/driver/dummy.rb +0 -0
  61. data/lib/kitchen/driver/exec.rb +1 -1
  62. data/lib/kitchen/driver/proxy.rb +1 -1
  63. data/lib/kitchen/driver/ssh_base.rb +0 -0
  64. data/lib/kitchen/errors.rb +0 -0
  65. data/lib/kitchen/generator/init.rb +1 -36
  66. data/lib/kitchen/instance.rb +0 -0
  67. data/lib/kitchen/lazy_hash.rb +1 -1
  68. data/lib/kitchen/loader/yaml.rb +31 -6
  69. data/lib/kitchen/logger.rb +1 -1
  70. data/lib/kitchen/logging.rb +0 -0
  71. data/lib/kitchen/login_command.rb +0 -0
  72. data/lib/kitchen/metadata_chopper.rb +0 -0
  73. data/lib/kitchen/platform.rb +0 -0
  74. data/lib/kitchen/provisioner.rb +0 -0
  75. data/lib/kitchen/provisioner/base.rb +0 -0
  76. data/lib/kitchen/provisioner/chef/berkshelf.rb +23 -19
  77. data/lib/kitchen/provisioner/chef/common_sandbox.rb +0 -0
  78. data/lib/kitchen/provisioner/chef/librarian.rb +25 -21
  79. data/lib/kitchen/provisioner/chef/policyfile.rb +23 -18
  80. data/lib/kitchen/provisioner/chef_apply.rb +2 -2
  81. data/lib/kitchen/provisioner/chef_base.rb +3 -2
  82. data/lib/kitchen/provisioner/chef_solo.rb +1 -1
  83. data/lib/kitchen/provisioner/chef_zero.rb +0 -0
  84. data/lib/kitchen/provisioner/dummy.rb +0 -0
  85. data/lib/kitchen/provisioner/shell.rb +0 -0
  86. data/lib/kitchen/rake_tasks.rb +0 -0
  87. data/lib/kitchen/shell_out.rb +0 -0
  88. data/lib/kitchen/ssh.rb +0 -0
  89. data/lib/kitchen/state_file.rb +0 -0
  90. data/lib/kitchen/suite.rb +0 -0
  91. data/lib/kitchen/thor_tasks.rb +0 -0
  92. data/lib/kitchen/transport.rb +0 -0
  93. data/lib/kitchen/transport/base.rb +0 -0
  94. data/lib/kitchen/transport/dummy.rb +0 -0
  95. data/lib/kitchen/transport/exec.rb +0 -0
  96. data/lib/kitchen/transport/ssh.rb +0 -0
  97. data/lib/kitchen/transport/winrm.rb +11 -5
  98. data/lib/kitchen/util.rb +0 -0
  99. data/lib/kitchen/verifier.rb +0 -0
  100. data/lib/kitchen/verifier/base.rb +0 -0
  101. data/lib/kitchen/verifier/busser.rb +0 -0
  102. data/lib/kitchen/verifier/dummy.rb +0 -0
  103. data/lib/kitchen/verifier/shell.rb +0 -0
  104. data/lib/kitchen/version.rb +1 -1
  105. data/lib/vendor/hash_recursive_merge.rb +0 -0
  106. data/spec/kitchen/base64_stream_spec.rb +0 -0
  107. data/spec/kitchen/cli_spec.rb +0 -0
  108. data/spec/kitchen/collection_spec.rb +0 -0
  109. data/spec/kitchen/color_spec.rb +0 -0
  110. data/spec/kitchen/config_spec.rb +0 -0
  111. data/spec/kitchen/configurable_spec.rb +0 -0
  112. data/spec/kitchen/data_munger_spec.rb +0 -0
  113. data/spec/kitchen/diagnostic_spec.rb +0 -0
  114. data/spec/kitchen/driver/base_spec.rb +0 -0
  115. data/spec/kitchen/driver/dummy_spec.rb +0 -0
  116. data/spec/kitchen/driver/exec_spec.rb +0 -0
  117. data/spec/kitchen/driver/proxy_spec.rb +0 -0
  118. data/spec/kitchen/driver/ssh_base_spec.rb +0 -0
  119. data/spec/kitchen/driver_spec.rb +0 -0
  120. data/spec/kitchen/errors_spec.rb +0 -0
  121. data/spec/kitchen/instance_spec.rb +0 -0
  122. data/spec/kitchen/lazy_hash_spec.rb +0 -0
  123. data/spec/kitchen/loader/yaml_spec.rb +43 -0
  124. data/spec/kitchen/logger_spec.rb +6 -1
  125. data/spec/kitchen/logging_spec.rb +0 -0
  126. data/spec/kitchen/login_command_spec.rb +0 -0
  127. data/spec/kitchen/metadata_chopper_spec.rb +0 -0
  128. data/spec/kitchen/platform_spec.rb +0 -0
  129. data/spec/kitchen/provisioner/base_spec.rb +0 -0
  130. data/spec/kitchen/provisioner/chef/policyfile_spec.rb +0 -0
  131. data/spec/kitchen/provisioner/chef_apply_spec.rb +0 -0
  132. data/spec/kitchen/provisioner/chef_base_spec.rb +6 -6
  133. data/spec/kitchen/provisioner/chef_solo_spec.rb +0 -0
  134. data/spec/kitchen/provisioner/chef_zero_spec.rb +0 -0
  135. data/spec/kitchen/provisioner/dummy_spec.rb +0 -0
  136. data/spec/kitchen/provisioner/shell_spec.rb +0 -0
  137. data/spec/kitchen/provisioner_spec.rb +0 -0
  138. data/spec/kitchen/shell_out_spec.rb +0 -0
  139. data/spec/kitchen/ssh_spec.rb +0 -0
  140. data/spec/kitchen/state_file_spec.rb +0 -0
  141. data/spec/kitchen/suite_spec.rb +0 -0
  142. data/spec/kitchen/transport/base_spec.rb +0 -0
  143. data/spec/kitchen/transport/exec_spec.rb +0 -0
  144. data/spec/kitchen/transport/ssh_spec.rb +0 -0
  145. data/spec/kitchen/transport/winrm_spec.rb +22 -13
  146. data/spec/kitchen/transport_spec.rb +0 -0
  147. data/spec/kitchen/util_spec.rb +0 -0
  148. data/spec/kitchen/verifier/base_spec.rb +0 -0
  149. data/spec/kitchen/verifier/busser_spec.rb +0 -0
  150. data/spec/kitchen/verifier/dummy_spec.rb +0 -0
  151. data/spec/kitchen/verifier/shell_spec.rb +0 -0
  152. data/spec/kitchen/verifier_spec.rb +0 -0
  153. data/spec/kitchen_spec.rb +0 -0
  154. data/spec/spec_helper.rb +0 -0
  155. data/spec/support/powershell_max_size_spec.rb +0 -0
  156. data/support/busser_install_command.ps1 +0 -0
  157. data/support/busser_install_command.sh +0 -0
  158. data/support/chef-client-fail-if-update-handler.rb +0 -0
  159. data/support/chef_base_init_command.ps1 +0 -0
  160. data/support/chef_base_init_command.sh +0 -0
  161. data/support/chef_base_install_command.ps1 +0 -0
  162. data/support/chef_base_install_command.sh +0 -0
  163. data/support/chef_zero_prepare_command_legacy.ps1 +0 -0
  164. data/support/chef_zero_prepare_command_legacy.sh +0 -0
  165. data/support/download_helpers.sh +0 -0
  166. data/support/dummy-validation.pem +0 -0
  167. data/templates/driver/CHANGELOG.md.erb +0 -0
  168. data/templates/driver/Gemfile.erb +0 -0
  169. data/templates/driver/README.md.erb +0 -0
  170. data/templates/driver/Rakefile.erb +0 -0
  171. data/templates/driver/driver.rb.erb +0 -0
  172. data/templates/driver/gemspec.erb +0 -0
  173. data/templates/driver/gitignore.erb +0 -0
  174. data/templates/driver/license_apachev2.erb +0 -0
  175. data/templates/driver/license_lgplv3.erb +0 -0
  176. data/templates/driver/license_mit.erb +0 -0
  177. data/templates/driver/license_reserved.erb +0 -0
  178. data/templates/driver/tailor.erb +0 -0
  179. data/templates/driver/travis.yml.erb +0 -0
  180. data/templates/driver/version.rb.erb +0 -0
  181. data/templates/init/chefignore.erb +0 -0
  182. data/templates/init/kitchen.yml.erb +2 -2
  183. data/test-kitchen.gemspec +1 -1
  184. data/test/cookbooks/test_cookbook/metadata.rb +0 -0
  185. data/test/cookbooks/test_cookbook/recipes/default.rb +0 -0
  186. data/test/integration/default/default_spec.rb +0 -0
  187. data/testing_windows.md +0 -0
  188. metadata +5 -5
@@ -103,24 +103,6 @@ module Kitchen
103
103
  # @api private
104
104
  attr_reader :always_update
105
105
 
106
- # Ensure the `chef` command is in the path.
107
- #
108
- # @param logger [Kitchen::Logger] the logger to use
109
- # @raise [UserError] if the `chef` command is not in the PATH
110
- # @api private
111
- def self.detect_chef_command!(logger)
112
- unless ENV["PATH"].split(File::PATH_SEPARATOR).any? do |p|
113
- File.exist?(File.join(p, "chef"))
114
- end
115
- logger.fatal("The `chef` executable cannot be found in your " \
116
- "PATH. Ensure you have installed ChefDK from " \
117
- "https://downloads.chef.io and that your PATH " \
118
- "setting includes the path to the `chef` comand.")
119
- raise UserError,
120
- "Could not find the chef executable in your PATH."
121
- end
122
- end
123
-
124
106
  # Escape spaces in a path in way that works with both Sh (Unix) and
125
107
  # Windows.
126
108
  #
@@ -143,6 +125,29 @@ module Kitchen
143
125
  Shellwords.escape(path)
144
126
  end
145
127
  end
128
+
129
+ class << self
130
+ private
131
+
132
+ # Ensure the `chef` command is in the path.
133
+ #
134
+ # @param logger [Kitchen::Logger] the logger to use
135
+ # @raise [UserError] if the `chef` command is not in the PATH
136
+ # @api private
137
+ def detect_chef_command!(logger)
138
+ unless ENV["PATH"].split(File::PATH_SEPARATOR).any? do |p|
139
+ File.exist?(File.join(p, "chef"))
140
+ end
141
+ logger.fatal("The `chef` executable cannot be found in your " \
142
+ "PATH. Ensure you have installed ChefDK from " \
143
+ "https://downloads.chef.io and that your PATH " \
144
+ "setting includes the path to the `chef` comand.")
145
+ raise UserError,
146
+ "Could not find the chef executable in your PATH."
147
+ end
148
+ end
149
+ end
150
+
146
151
  end
147
152
  end
148
153
  end
@@ -30,8 +30,8 @@
30
30
  # name: chef_apply
31
31
  #
32
32
  # platforms:
33
- # - name: ubuntu-12.04
34
- # - name: centos-6.4
33
+ # - name: ubuntu-16.04
34
+ # - name: centos-7
35
35
  #
36
36
  # suites:
37
37
  # - name: default
@@ -503,8 +503,9 @@ module Kitchen
503
503
  end
504
504
 
505
505
  def install_from_file(command)
506
- install_file = "/tmp/chef-installer.sh"
507
- script = ["cat > #{install_file} <<\"EOL\""]
506
+ install_file = "#{config[:root_path]}/chef-installer.sh"
507
+ script = ["mkdir -p #{config[:root_path]}"]
508
+ script << "cat > #{install_file} <<\"EOL\""
508
509
  script << command
509
510
  script << "EOL"
510
511
  script << "chmod +x #{install_file}"
@@ -64,7 +64,7 @@ module Kitchen
64
64
 
65
65
  # (see Base#run_command)
66
66
  def run_command
67
- config[:log_level] = "info" if !modern? && config[:log_level] = "auto"
67
+ config[:log_level] = "info" if !modern? && config[:log_level] == "auto"
68
68
  cmd = sudo(config[:chef_solo_path]).dup
69
69
  .tap { |str| str.insert(0, "& ") if powershell_shell? }
70
70
 
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/kitchen/ssh.rb CHANGED
File without changes
File without changes
data/lib/kitchen/suite.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -48,13 +48,12 @@ module Kitchen
48
48
  default_config :connection_retry_sleep, 1
49
49
  default_config :max_wait_until_ready, 600
50
50
  default_config :winrm_transport, :negotiate
51
+ default_config :scheme do |transport|
52
+ transport[:winrm_transport] == :ssl ? "https" : "http"
53
+ end
51
54
  default_config :port do |transport|
52
55
  transport[:winrm_transport] == :ssl ? 5986 : 5985
53
56
  end
54
- default_config :endpoint_template do |transport|
55
- scheme = transport[:winrm_transport] == :ssl ? "https" : "http"
56
- "#{scheme}://%{hostname}:%{port}/wsman"
57
- end
58
57
 
59
58
  def finalize_config!(instance)
60
59
  super
@@ -388,6 +387,13 @@ module Kitchen
388
387
  # @return [Hash] hash of connection options
389
388
  # @api private
390
389
  def connection_options(data)
390
+ endpoint = URI::Generic.build(
391
+ scheme: data.fetch(:scheme),
392
+ host: data.fetch(:hostname),
393
+ port: data.fetch(:port),
394
+ path: "/wsman"
395
+ ).to_s
396
+
391
397
  elevated_password = data[:password]
392
398
  elevated_password = data[:elevated_password] if data.key?(:elevated_password)
393
399
 
@@ -395,7 +401,7 @@ module Kitchen
395
401
  instance_name: instance.name,
396
402
  kitchen_root: data[:kitchen_root],
397
403
  logger: logger,
398
- endpoint: data[:endpoint_template] % data,
404
+ endpoint: endpoint,
399
405
  user: data[:username],
400
406
  password: data[:password],
401
407
  rdp_port: data[:rdp_port],
data/lib/kitchen/util.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -17,5 +17,5 @@
17
17
  # limitations under the License.
18
18
 
19
19
  module Kitchen
20
- VERSION = "1.20.0".freeze
20
+ VERSION = "1.21.0".freeze
21
21
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -43,6 +43,14 @@ describe Kitchen::Loader::YAML do
43
43
 
44
44
  describe ".initialize" do
45
45
  it "sets project_config based on Dir.pwd by default" do
46
+ stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
47
+ loader = Kitchen::Loader::YAML.new
48
+
49
+ loader.diagnose[:project_config][:filename]
50
+ .must_equal File.expand_path(File.join(Dir.pwd, "kitchen.yml"))
51
+ end
52
+
53
+ it "when kitchen.yml not present, falls back to .kitchen.yml" do
46
54
  stub_file(File.join(Dir.pwd, ".kitchen.yml"), {})
47
55
  loader = Kitchen::Loader::YAML.new
48
56
 
@@ -50,6 +58,20 @@ describe Kitchen::Loader::YAML do
50
58
  .must_equal File.expand_path(File.join(Dir.pwd, ".kitchen.yml"))
51
59
  end
52
60
 
61
+ it "prefers kitchen.yml to .kitchen.yml" do
62
+ stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
63
+ loader = Kitchen::Loader::YAML.new
64
+
65
+ loader.diagnose[:project_config][:filename]
66
+ .must_equal File.expand_path(File.join(Dir.pwd, "kitchen.yml"))
67
+ end
68
+
69
+ it "errors when kitchen.yml and .kitchen.yml are both present" do
70
+ stub_file(File.join(Dir.pwd, "kitchen.yml"), {})
71
+ stub_file(File.join(Dir.pwd, ".kitchen.yml"), {})
72
+ proc { Kitchen::Loader::YAML.new }.must_raise Kitchen::UserError
73
+ end
74
+
53
75
  it "sets project_config from parameter, if given" do
54
76
  stub_file("/tmp/crazyfunkytown.file", {})
55
77
  loader = Kitchen::Loader::YAML.new(
@@ -76,6 +98,13 @@ describe Kitchen::Loader::YAML do
76
98
  .must_match %r{/tmp/.kitchen.local.yml$}
77
99
  end
78
100
 
101
+ it "errors if both visible and hidden copies of default local_config exist" do
102
+ stub_file("/tmp/kitchen.local.yml", {})
103
+ stub_file("/tmp/.kitchen.local.yml", {})
104
+ proc { Kitchen::Loader::YAML.new(project_config: "/tmp/.kitchen.yml") }
105
+ .must_raise Kitchen::UserError
106
+ end
107
+
79
108
  it "sets local_config from parameter, if given" do
80
109
  stub_file("/tmp/crazyfunkytown.file", {})
81
110
  loader = Kitchen::Loader::YAML.new(
@@ -405,6 +434,20 @@ describe Kitchen::Loader::YAML do
405
434
  loader.read.must_equal(name: "ahhchoo")
406
435
  end
407
436
 
437
+ it "accepts kitchen.yml with alias" do
438
+ FileUtils.mkdir_p "/tmp"
439
+ File.open("/tmp/.kitchen.yml", "wb") do |f|
440
+ f.write <<-'YAML'.gsub(/^ {10}/, "")
441
+ ---
442
+ xxx: &k
443
+ foo: bar
444
+ yyy: *k
445
+ YAML
446
+ end
447
+
448
+ loader.read[:yyy].must_equal(foo: "bar")
449
+ end
450
+
408
451
  it "raises a UserError if there is an ERB processing error" do
409
452
  FileUtils.mkdir_p "/tmp"
410
453
  File.open("/tmp/.kitchen.yml", "wb") do |f|
@@ -34,6 +34,11 @@ describe Kitchen::Logger do
34
34
  Kitchen::Color.colorize(*args)
35
35
  end
36
36
 
37
+ def log_tmpname
38
+ t = Time.now.strftime("%Y%m%d")
39
+ "kitchen-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}.log"
40
+ end
41
+
37
42
  let(:opts) do
38
43
  { color: :red, colorize: true }
39
44
  end
@@ -356,7 +361,7 @@ describe Kitchen::Logger do
356
361
  end
357
362
 
358
363
  describe "file IO logdev-based logger" do
359
- let(:logfile) { Dir::Tmpname.make_tmpname(%w{kitchen .log}, nil) }
364
+ let(:logfile) { File.join Dir.tmpdir, log_tmpname }
360
365
 
361
366
  before do
362
367
  opts[:logdev] = logfile
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -768,13 +768,13 @@ describe Kitchen::Provisioner::ChefBase do
768
768
 
769
769
  it "sets chef component dirs for deletion" do
770
770
  config[:root_path] = '\\route'
771
- dirs = %w{
772
- "\\route\\clients" "\\route\\cookbooks" "\\route\\data"
773
- "\\route\\data_bags" "\\route\\encrypted_data_bag_secret"
774
- "\\route\\environments" "\\route\\roles"
775
- }.join(", ")
771
+ dirs = %w{ clients cookbooks data data_bags encrypted_data_bag_secret
772
+ environments roles
773
+ }.map do |dir|
774
+ "\\route\\#{dir}"
775
+ end.join(", ")
776
776
 
777
- cmd.must_match regexify(%{$dirs = @(#{dirs})})
777
+ cmd.include? "$dirs = @(#{dirs})"
778
778
  end
779
779
 
780
780
  it "sets the root_path from :root_path" do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -68,6 +68,10 @@ describe Kitchen::Transport::Winrm do
68
68
  end
69
69
 
70
70
  describe "default_config" do
71
+ it "sets :scheme to http by default" do
72
+ transport[:scheme].must_equal "http"
73
+ end
74
+
71
75
  it "sets :port to 5985 by default" do
72
76
  transport[:port].must_equal 5985
73
77
  end
@@ -80,11 +84,6 @@ describe Kitchen::Transport::Winrm do
80
84
  transport[:password].must_be_nil
81
85
  end
82
86
 
83
- it "sets a default :endpoint_template value" do
84
- transport[:endpoint_template]
85
- .must_equal "http://%{hostname}:%{port}/wsman"
86
- end
87
-
88
87
  it "sets :rdp_port to 3389 by default" do
89
88
  transport[:rdp_port].must_equal 3389
90
89
  end
@@ -164,27 +163,37 @@ describe Kitchen::Transport::Winrm do
164
163
  make_connection
165
164
  end
166
165
 
166
+ it "sets :endpoint when hostname is an IPv6 address" do
167
+ config[:hostname] = "caec:cec6:c4ef:bb7b:1a78:d055:216d:3a78"
168
+
169
+ klass.expects(:new).with do |hash|
170
+ hash[:endpoint] == "http://[caec:cec6:c4ef:bb7b:1a78:d055:216d:3a78]:5985/wsman"
171
+ end
172
+
173
+ make_connection
174
+ end
175
+
167
176
  it "sets :endpoint from data in config" do
168
- config[:hostname] = "host_from_config"
169
- config[:port] = "port_from_config"
177
+ config[:hostname] = "host-from-config"
178
+ config[:port] = "42"
170
179
  config[:winrm_transport] = "ssl"
171
180
 
172
181
  klass.expects(:new).with do |hash|
173
- hash[:endpoint] == "https://host_from_config:port_from_config/wsman"
182
+ hash[:endpoint] == "https://host-from-config:42/wsman"
174
183
  end
175
184
 
176
185
  make_connection
177
186
  end
178
187
 
179
188
  it "sets :endpoint from data in state over config data" do
180
- state[:hostname] = "host_from_state"
181
- config[:hostname] = "host_from_config"
182
- state[:port] = "port_from_state"
183
- config[:port] = "port_from_config"
189
+ state[:hostname] = "host-from-state"
190
+ config[:hostname] = "host-from-config"
191
+ state[:port] = "42"
192
+ config[:port] = "43"
184
193
  config[:winrm_transport] = "ssl"
185
194
 
186
195
  klass.expects(:new).with do |hash|
187
- hash[:endpoint] == "https://host_from_state:port_from_state/wsman"
196
+ hash[:endpoint] == "https://host-from-state:42/wsman"
188
197
  end
189
198
 
190
199
  make_connection