From 7b4890ddf6c3faa23f7964cda38b289a40b31fb5 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Mon, 2 Jan 2017 21:28:12 -0800 Subject: [PATCH] check .travis.yml ruby verison matches pages https://github.com/github/choosealicense.com/pull/472#issuecomment-270048688 very rough, naive, probably bad implementation --- spec/ci_ruby_version_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/ci_ruby_version_spec.rb diff --git a/spec/ci_ruby_version_spec.rb b/spec/ci_ruby_version_spec.rb new file mode 100644 index 0000000..e787015 --- /dev/null +++ b/spec/ci_ruby_version_spec.rb @@ -0,0 +1,21 @@ +require 'json' +require 'open-uri' +require 'spec_helper' +require 'yaml' + +describe 'ci ruby version' do + pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read) + pages_ruby_version = pages_versions['ruby'] + + ci_config_file = '.travis.yml' + + ci_config = YAML.load_file(ci_config_file) + ci_ruby_version = ci_config['rvm'][0] + + context "#{ci_config_file} and pages ruby versions" do + it 'do not match' do + msg = "(#{ci_ruby_version}) != (#{pages_ruby_version})" + expect(ci_ruby_version).to eql(pages_ruby_version), msg + end + end +end