Sha256: 0ac24ceff8305fffed86e3ccc86b46bbc376e09907b7a26574308626bf92147f
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require 'test_helper' class WhitelistTest < ASDeprecationTracker::TestCase def setup @whitelist = ASDeprecationTracker::Whitelist.new super end def test_add_to_list @whitelist.add_to_list([entry]) assert_equal 1, @whitelist.list.count end def test_clear @whitelist.add_to_list([entry]) @whitelist.clear assert @whitelist.list.empty? end def test_load_file File.expects(:read).with('root/config/as_deprecation_whitelist.yaml').returns("---\n- :message: test\n") @whitelist.load_file('root/config/as_deprecation_whitelist.yaml') assert_equal 1, @whitelist.list.count end def test_matches_failure @whitelist.add_to_list([entry]) deprecation = mock('deprecation') @whitelist.list.first.expects(:matches?).with(deprecation).returns(false) refute @whitelist.matches?(deprecation) end def test_matches_success @whitelist.add_to_list([entry]) deprecation = mock('deprecation') @whitelist.list.first.expects(:matches?).with(deprecation).returns(true) assert @whitelist.matches?(deprecation) end private def entry { message: 'deprecated call', callstack: caller } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
as_deprecation_tracker-1.0.0 | test/whitelist_test.rb |