summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:09:07 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:09:07 -0700
commit7a1a6c8ef26c787e4b6dd1602f3d158b37e81720 (patch)
tree1e390cd535b38368d091cbb33e5d419408d5ce00 /spec/functional
parent77f8739a4741e2370e40ec39345a92a6ea393a1a (diff)
downloadchef-7a1a6c8ef26c787e4b6dd1602f3d158b37e81720.tar.gz
fix Layout/EmptyLineAfterGuardClause
i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/mixin/user_context_spec.rb2
-rw-r--r--spec/functional/resource/cron_spec.rb1
-rw-r--r--spec/functional/run_lock_spec.rb1
3 files changed, 4 insertions, 0 deletions
diff --git a/spec/functional/mixin/user_context_spec.rb b/spec/functional/mixin/user_context_spec.rb
index 802b1db9f1..5beed18166 100644
--- a/spec/functional/mixin/user_context_spec.rb
+++ b/spec/functional/mixin/user_context_spec.rb
@@ -36,12 +36,14 @@ describe Chef::Mixin::UserContext, windows_only: true do
if succeeded || last_error != Chef::ReservedNames::Win32::API::Error::ERROR_INSUFFICIENT_BUFFER
raise Chef::Exceptions::Win32APIError, "Expected ERROR_INSUFFICIENT_BUFFER from GetUserNameA but it returned the following error: #{last_error}"
end
+
user_name = FFI::MemoryPointer.new :char, (name_size.read_long)
succeeded = get_user_name_a.call(user_name, name_size)
last_error = FFI::LastError.error
if succeeded == 0 || last_error != 0
raise Chef::Exceptions::Win32APIError, "GetUserNameA failed with #{lasterror}"
end
+
user_name.read_string
end
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index f616b84ce9..16b0d2645c 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -118,6 +118,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
def cron_attribute_should_exists(cron_name, attribute, value)
return if %w{aix solaris}.include?(ohai[:platform])
+
# Test if the attribute exists on newly created cron
cron_should_exists(cron_name, "")
expect(shell_out("crontab -l -u #{new_resource.user} | grep '#{attribute.upcase}=\"#{value}\"'").exitstatus).to eq(0)
diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb
index 49972360ef..825f2810d4 100644
--- a/spec/functional/run_lock_spec.rb
+++ b/spec/functional/run_lock_spec.rb
@@ -334,6 +334,7 @@ describe Chef::RunLock do
loop do
line = readline_nonblock(read_from_process)
break if line.nil?
+
event, time = line.split("@")
example.log_event("#{name}.last_event got #{event}")
example.log_event("[#{name}] #{event}", time.strip)