From 1a3e4172af0618d774e77d4ea02d4f0502687b79 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 28 Feb 2019 11:55:51 +0530 Subject: [PATCH] Enable testing for Windows platform (#265) Merge pull request 265 --- Gemfile | 5 +++++ appveyor.yml | 23 +++++++++++++++++++++++ spec/jekyll-feed_spec.rb | 1 + spec/spec_helper.rb | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 appveyor.yml diff --git a/Gemfile b/Gemfile index e5cf9dca..bd12ee7a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,8 @@ source "https://rubygems.org" gemspec gem "jekyll", "~> #{ENV["JEKYLL_VERSION"]}" if ENV["JEKYLL_VERSION"] + +install_if -> { Gem.win_platform? } do + gem "tzinfo", "~> 1.2" + gem "tzinfo-data" +end diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..8150bee1 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,23 @@ +version: "{build}" +clone_depth: 5 +build: off + +environment: + NOKOGIRI_USE_SYSTEM_LIBRARIES: true + matrix: + - RUBY_FOLDER_VER: "26" + - RUBY_FOLDER_VER: "24" + +install: + - SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH% + - bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle + +test_script: + - ruby --version + - gem --version + - bundler --version + - bash ./script/test + +cache: + # If one of the files after the right arrow changes, cache will be invalidated + - 'vendor\bundle -> appveyor.yml, Gemfile, jekyll-feed.gemspec' diff --git a/spec/jekyll-feed_spec.rb b/spec/jekyll-feed_spec.rb index 1a8cc5c7..fd793d0d 100644 --- a/spec/jekyll-feed_spec.rb +++ b/spec/jekyll-feed_spec.rb @@ -205,6 +205,7 @@ context "validation" do it "validates" do + skip "Typhoeus couldn't find the 'libcurl' module on Windows" if Gem.win_platform? # See https://validator.w3.org/docs/api.html url = "https://validator.w3.org/feed/check.cgi?output=soap12" response = Typhoeus.post(url, :body => { :rawdata => contents }, :accept_encoding => "gzip") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8f1bbe70..7ea33867 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "jekyll" -require "typhoeus" +require "typhoeus" unless Gem.win_platform? require "nokogiri" require "rss" require File.expand_path("../lib/jekyll-feed", __dir__)