From 7b4890ddf6c3faa23f7964cda38b289a40b31fb5 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Mon, 2 Jan 2017 21:28:12 -0800 Subject: [PATCH 1/3] 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 From 7de7b2c8ef45fa3ca38d0a24318e1ac9f7d53cc9 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Tue, 3 Jan 2017 10:18:27 -0800 Subject: [PATCH 2/3] affirmative wording https://github.com/github/choosealicense.com/pull/473#discussion_r94403400 --- spec/ci_ruby_version_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/ci_ruby_version_spec.rb b/spec/ci_ruby_version_spec.rb index e787015..3b47ec5 100644 --- a/spec/ci_ruby_version_spec.rb +++ b/spec/ci_ruby_version_spec.rb @@ -12,8 +12,8 @@ describe 'ci ruby version' do 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 + context "in #{ci_config_file} and pages ruby version" do + it 'match' do msg = "(#{ci_ruby_version}) != (#{pages_ruby_version})" expect(ci_ruby_version).to eql(pages_ruby_version), msg end From fad13d2de4bdd91c1dda5d236a4460018f9a6124 Mon Sep 17 00:00:00 2001 From: Mike Linksvayer Date: Wed, 4 Jan 2017 08:53:18 -0800 Subject: [PATCH 3/3] document fixing error in test output https://github.com/github/choosealicense.com/pull/473#issuecomment-270185138 --- spec/ci_ruby_version_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/ci_ruby_version_spec.rb b/spec/ci_ruby_version_spec.rb index 3b47ec5..7a39ad5 100644 --- a/spec/ci_ruby_version_spec.rb +++ b/spec/ci_ruby_version_spec.rb @@ -14,7 +14,7 @@ describe 'ci ruby version' do context "in #{ci_config_file} and pages ruby version" do it 'match' do - msg = "(#{ci_ruby_version}) != (#{pages_ruby_version})" + msg = "#{ci_ruby_version} != #{pages_ruby_version}; please add a commit bumping in #{ci_config_file}" expect(ci_ruby_version).to eql(pages_ruby_version), msg end end