test/test_unit.rb in vacuum-2.0.2 vs test/test_unit.rb in vacuum-2.1.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'minitest/autorun'
require_relative '../lib/vacuum'
class TestVacuum < Minitest::Test
include Vacuum
@@ -45,11 +47,11 @@
end
def test_force_encodes_body
res = Object.new
def res.body
- ''.force_encoding('ASCII-8BIT')
+ (+'').force_encoding(Encoding::ASCII_8BIT)
end
assert_equal 'UTF-8', Response.new(res).body.encoding.name
end
def test_sets_custom_parser_on_class_level
@@ -92,10 +94,10 @@
def test_handles_unauthorized_errors
Excon.stub({}, status: 403)
res = @req.item_lookup(query: {}, mock: true)
assert_equal 403, res.status
- assert_raises Excon::Error do
+ assert_raises Excon::Error::Forbidden do
@req.item_lookup(query: {}, expects: 200, mock: true)
end
end
end