-
Notifications
You must be signed in to change notification settings - Fork 0
/
comparison_test.rb
60 lines (45 loc) · 1.44 KB
/
comparison_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# frozen_string_literal: true
require "test_helper"
class ComparisonTest < Minitest::Test
include KeywordTestHelper
def setup
@delegation_positional_args = DelegationWithPositionalArgs.new
@delegation_keyword_args = DelegationWithKeywordArgs.new
end
def test_get_method_handles_empty_bracket_with_warnings
result_1, _err = with_error do
@delegation_positional_args.put(:foo, {})
end
result_2, _err = with_error do
@delegation_keyword_args.put(:foo, {})
end
assert_equal result_1, result_2
end
def test_get_method_handles_null_option_properly
result_1, _err = with_error do
@delegation_positional_args.put(:foo)
end
result_2, _err = with_error do
@delegation_keyword_args.put(:foo)
end
assert_equal result_1, result_2
end
def test_get_method_handles_keyword_arguments_properly
result_1, _err = with_error do
result_1 = @delegation_positional_args.put(:foo, bar: :baz, qux: 123)
end
result_2, _err = with_error do
@delegation_keyword_args.put(:foo, bar: :baz, qux: 123)
end
assert_equal result_1, result_2
end
def test_get_method_handles_hash_objects_with_warnings
result_1, _err = with_error do
@delegation_positional_args.put(:foo, { bar: :baz, qux: 123 })
end
result_2, _err = with_error do
@delegation_keyword_args.put(:foo, { bar: :baz, qux: 123 })
end
assert_equal result_1, result_2
end
end