Skip to content

Commit

Permalink
Update instrumentation/pg/test/opentelemetry/instrumentation/pg/instr…
Browse files Browse the repository at this point in the history
…umentation_test.rb

Co-authored-by: Robb Kidd <[email protected]>
  • Loading branch information
hannahramadan and robbkidd authored Aug 1, 2024
1 parent db8b58c commit b4449b4
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,21 @@
end
end

def self.load_fixture
data = File.read("#{Dir.pwd}/test/fixtures/sql_table_name.json")
JSON.parse(data)
end
describe '#connection_name' do
def self.load_fixture
data = File.read("#{Dir.pwd}/test/fixtures/sql_table_name.json")
JSON.parse(data)
end

load_fixture.each do |test_case|
name = test_case['name']
query = test_case['sql']
load_fixture.each do |test_case|
name = test_case['name']
query = test_case['sql']

define_method(:"test_sql_table_name_#{name}") do
table_name = client.send(:collection_name, query)
define_method(:"test_sql_table_name_#{name}") do
table_name = client.send(:collection_name, query)

assert('test_table', table_name)
assert_equal('table_name', table_name) # TODO: use an expected name from fixtures or update fixtures to always use "table_name"
end
end
end
end unless ENV['OMIT_SERVICES']
Expand Down

0 comments on commit b4449b4

Please sign in to comment.