Try different method

This should only have ExceptionMatcher's match data types
This commit is contained in:
Michael Miller 2019-03-22 00:37:15 -06:00
parent 7b10330904
commit 5b03ddb7e3
2 changed files with 14 additions and 6 deletions

View file

@ -94,7 +94,7 @@ describe Spectator::Matchers::ExceptionMatcher do
partial = new_block_partial { raise ArgumentError.new }
matcher = Spectator::Matchers::ExceptionMatcher(KeyError, Nil).new
match_data = matcher.match(partial)
match_data_prefix(match_data, :"expected type")[:value].should eq(KeyError)
match_data_prefix2(match_data, :"expected type")[:value].should eq(KeyError)
end
end
@ -103,7 +103,7 @@ describe Spectator::Matchers::ExceptionMatcher do
partial = new_block_partial { raise ArgumentError.new }
matcher = Spectator::Matchers::ExceptionMatcher(KeyError, Nil).new
match_data = matcher.match(partial)
match_data_prefix(match_data, :"actual type")[:value].should eq(ArgumentError)
match_data_prefix2(match_data, :"actual type")[:value].should eq(ArgumentError)
end
context "when nothing is raised" do
@ -111,7 +111,7 @@ describe Spectator::Matchers::ExceptionMatcher do
partial = new_block_partial { 42 }
matcher = Spectator::Matchers::ExceptionMatcher(KeyError, Nil).new
match_data = matcher.match(partial)
match_data_prefix(match_data, :"actual type")[:value].should eq(Nil)
match_data_prefix2(match_data, :"actual type")[:value].should eq(Nil)
end
end
end
@ -122,7 +122,7 @@ describe Spectator::Matchers::ExceptionMatcher do
partial = new_block_partial { raise ArgumentError.new("foobar") }
matcher = Spectator::Matchers::ExceptionMatcher(KeyError, Regex).new(regex, "label")
match_data = matcher.match(partial)
match_data_prefix(match_data, :"expected message")[:value].should eq(regex)
match_data_prefix2(match_data, :"expected message")[:value].should eq(regex)
end
end
@ -132,7 +132,7 @@ describe Spectator::Matchers::ExceptionMatcher do
partial = new_block_partial { raise ArgumentError.new(message) }
matcher = Spectator::Matchers::ExceptionMatcher(KeyError, Regex).new(/baz/, "label")
match_data = matcher.match(partial)
match_data_prefix(match_data, :"actual message")[:value].should eq(message)
match_data_prefix2(match_data, :"actual message")[:value].should eq(message)
end
end
end