From f4d1976373cdc7612976892c012983f5735a4db4 Mon Sep 17 00:00:00 2001 From: Akzhan Abdulin Date: Tue, 28 Jun 2016 01:57:12 +0300 Subject: [PATCH] skipjava --- lib/css_parser/parser.rb | 2 +- test/test_css_parser_loading.rb | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/css_parser/parser.rb b/lib/css_parser/parser.rb index b59fcaa..ac67676 100644 --- a/lib/css_parser/parser.rb +++ b/lib/css_parser/parser.rb @@ -488,7 +488,7 @@ def read_remote_file(uri) # :nodoc: return '', nil elsif res.code.to_i >= 300 and res.code.to_i < 400 if res.response['Location'] != nil - return read_remote_file Addressable::URI.parse(URI::encode(res.response['Location'])) + return read_remote_file Addressable::URI.parse(URI.escape(res.response['Location'])) end end diff --git a/test/test_css_parser_loading.rb b/test/test_css_parser_loading.rb index 6b80b94..c25db56 100644 --- a/test/test_css_parser_loading.rb +++ b/test/test_css_parser_loading.rb @@ -5,14 +5,6 @@ class CssParserLoadingTests < Minitest::Test include CssParser include WEBrick - def pending_if(condition, reason, &block) - if condition - pending(reason, &block) - else - yield - end - end - def setup # from http://nullref.se/blog/2006/5/17/testing-with-webrick @cp = Parser.new @@ -78,7 +70,9 @@ def test_loading_a_remote_file # http://github.com/premailer/css_parser/issues#issue/4 def test_loading_a_remote_file_over_ssl # TODO: test SSL locally - pending_if(RUBY_PLATFORM =~ /java|jruby/, "does not work on jruby") do + if RUBY_PLATFORM == 'java' + skip "SSL: does not work on jruby" + else @cp.load_uri!("https://dialect.ca/inc/screen.css") assert_match( /margin\: 0\;/, @cp.find_by_selector('body').join(' ') ) end