summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-02 09:40:00 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-02 09:40:00 -0800
commit5536dd9e73159e3eff1b42be79f46d6f0540c4a1 (patch)
tree1ccc8cd6312f2fa638f695d439828513612caaba
parent35c3c136c0d12e47fe6b79c6e49f65c293dc344d (diff)
parent89f8987c8aa21223e7f93f174f889ce4a679d9b6 (diff)
downloadchef-5536dd9e73159e3eff1b42be79f46d6f0540c4a1.tar.gz
Merge pull request #4510 from chef/jdm/win-evt-fast
Make windows event log tests faster
-rw-r--r--spec/functional/event_loggers/windows_eventlog_spec.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/functional/event_loggers/windows_eventlog_spec.rb b/spec/functional/event_loggers/windows_eventlog_spec.rb
index cfab3763e1..eab58adede 100644
--- a/spec/functional/event_loggers/windows_eventlog_spec.rb
+++ b/spec/functional/event_loggers/windows_eventlog_spec.rb
@@ -25,16 +25,21 @@ if Chef::Platform.windows? and not Chef::Platform::windows_server_2003?
end
describe Chef::EventLoggers::WindowsEventLogger, :windows_only, :not_supported_on_win2k3 do
- let(:run_id) { SecureRandom.uuid }
- let(:version) { SecureRandom.uuid }
- let(:elapsed_time) { SecureRandom.random_number(100) }
+ def rand
+ random.rand(1<<32).to_s
+ end
+
+ let(:random) { Random.new }
+ let(:run_id) { rand }
+ let(:version) { rand }
+ let(:elapsed_time) { rand }
let(:logger) { Chef::EventLoggers::WindowsEventLogger.new }
let(:flags) { nil }
let(:node) { nil }
let(:run_status) { double("Run Status", {run_id: run_id, elapsed_time: elapsed_time }) }
let(:event_log) { EventLog.new("Application") }
let!(:offset) { event_log.read_last_event.record_number }
- let(:mock_exception) { double("Exception", {message: SecureRandom.uuid, backtrace:[SecureRandom.uuid, SecureRandom.uuid]})}
+ let(:mock_exception) { double("Exception", {message: rand, backtrace:[rand, rand]})}
it "is available" do
expect(Chef::EventLoggers::WindowsEventLogger.available?).to be_truthy