Skip to content

Commit

Permalink
Uniformize variable names in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <[email protected]>
  • Loading branch information
Morriar committed Aug 6, 2024
1 parent edda975 commit 9dae5b5
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 294 deletions.
16 changes: 8 additions & 8 deletions test/rbi/index_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class IndexTest < Minitest::Test
extend T::Sig

def test_index_empty_trees
rbi = Tree.new
index_string = index_string(rbi.index)
tree = Tree.new
index_string = index_string(tree.index)
assert_empty(index_string)
end

def test_index_scopes_and_consts
rbi = parse_rbi(<<~RBI)
tree = parse_rbi(<<~RBI)
class A
module B
module ::C; end
Expand All @@ -28,7 +28,7 @@ class << self; end
A::B = 10
RBI

index_string = index_string(rbi.index)
index_string = index_string(tree.index)
assert_equal(<<~IDX, index_string)
::A: -:1:0-5:3, -:7:2-7:16
::A::B: -:2:2-4:5, -:10:0-10:9
Expand All @@ -39,7 +39,7 @@ class << self; end
end

def test_index_properties
rbi = parse_rbi(<<~RBI)
tree = parse_rbi(<<~RBI)
class A
attr_reader :a, :b
attr_writer :a, :b
Expand All @@ -52,7 +52,7 @@ def foo(a); end
end
RBI

index_string = index_string(rbi.index)
index_string = index_string(tree.index)
assert_equal(<<~IDX, index_string)
::A: -:1:0-10:3
::A#a: -:2:2-2:20
Expand All @@ -71,7 +71,7 @@ def foo(a); end
end

def test_index_sorbet_constructs
rbi = parse_rbi(<<~RBI)
tree = parse_rbi(<<~RBI)
class A < T::Struct
const :a, Integer
prop :b, String
Expand All @@ -90,7 +90,7 @@ class B < T::Enum
D = type_template
RBI

index_string = index_string(rbi.index)
index_string = index_string(tree.index)
assert_equal(<<~IDX, index_string)
.mixes_in_class_method(A): -:13:0-13:24
.requires_ancestor(A): -:14:0-14:23
Expand Down
Loading

0 comments on commit 9dae5b5

Please sign in to comment.