Skip to content

Commit fe71dd1

Browse files
committed
Fix spec to actually test exception message
second argument to assert_raises is custom error message
1 parent 93ae821 commit fe71dd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/rule_set/test_declarations.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require_relative '../test_helper'
44
require 'minitest/spec'
5+
require 'ostruct'
56

67
class RuleSetDeclarationsTest < Minitest::Test
78
describe '.new' do
@@ -72,8 +73,11 @@ class RuleSetDeclarationsTest < Minitest::Test
7273
it 'raises an exception including the property when the value is empty' do
7374
declarations = CssParser::RuleSet::Declarations.new
7475

75-
assert_raises ArgumentError, 'foo value is empty' do
76+
assert_raises ArgumentError do
7677
declarations['foo'] = '!important'
78+
rescue ArgumentError => e
79+
assert_equal e.message, 'foo value is empty'
80+
raise e
7781
end
7882
end
7983
end

0 commit comments

Comments
 (0)