summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2018-04-11 10:23:24 +0100
committerThom May <thom@may.lt>2018-04-11 10:23:24 +0100
commit9528ad9e6a54cfda74253eb03b4220f97a4bbb29 (patch)
treea5ac52fb74452abafc212436cd00a57bd1d4bf94
parent7c754a5ebdc3a66e028783dbc15ec616f876e2f9 (diff)
downloadmixlib-log-9528ad9e6a54cfda74253eb03b4220f97a4bbb29.tar.gz
Add appveyor config
-rw-r--r--appveyor.yml41
-rw-r--r--spec/mixlib/log_spec.rb17
2 files changed, 50 insertions, 8 deletions
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..9247b10
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,41 @@
+version: "master-{build}"
+
+os: Visual Studio 2017
+platform:
+ - x64
+
+cache:
+ - vendor/bundle
+
+environment:
+ matrix:
+ - ruby_version: "25-x64"
+
+clone_depth: 1
+skip_tags: true
+skip_branch_with_pr: true
+branches:
+ only:
+ - master
+
+install:
+ - systeminfo
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
+ - echo %PATH%
+ - appveyor DownloadFile http://curl.haxx.se/ca/cacert.pem -FileName C:\cacert.pem
+ - set SSL_CERT_FILE=C:\cacert.pem
+ - SET BUNDLE_WITHOUT=server:docgen:maintenance:pry:travis:integration:ci
+ - bundle config --local path vendor/bundle # use the cache we define above
+ - bundle install || bundle install || bundle install
+
+build: off
+
+before_test:
+ - ruby --version
+ - gem --version
+ - bundler --version
+ - bundle env
+
+test_script:
+ - SET SPEC_OPTS=--format progress
+ - bundle exec rake \ No newline at end of file
diff --git a/spec/mixlib/log_spec.rb b/spec/mixlib/log_spec.rb
index 60da408..5618a50 100644
--- a/spec/mixlib/log_spec.rb
+++ b/spec/mixlib/log_spec.rb
@@ -189,15 +189,16 @@ RSpec.describe Mixlib::Log do
ObjectSpace.each_object(File) do |f|
opened_files_count_before += 1 unless f.closed?
end
- file = File.open("/tmp/logger.log")
- Logit.init(file)
- Logit.init(file)
- Logit.init(file)
- opened_files_count_after = 0
- ObjectSpace.each_object(File) do |f|
- opened_files_count_after += 1 unless f.closed?
+ Tempfile.open("chef-test-log") do |file|
+ Logit.init(file)
+ Logit.init(file)
+ Logit.init(file)
+ opened_files_count_after = 0
+ ObjectSpace.each_object(File) do |f|
+ opened_files_count_after += 1 unless f.closed?
+ end
+ expect(opened_files_count_after).to eq(opened_files_count_before + 1)
end
- expect(opened_files_count_after).to eq(opened_files_count_before + 1)
end
it "should return nil from its logging methods" do