Skip to content

Commit

Permalink
Add specs
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Shilov <[email protected]>
  • Loading branch information
shlima committed Nov 20, 2022
1 parent e3133a3 commit 46790bf
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions spec/click_house/integration/formats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 6,54 @@
end

context 'when RowBinary' do
let(:query) do
'SELECT 1 FORMAT RowBinary'
end

it '#select_one' do
got = subject.select_one('SELECT 1 FORMAT RowBinary')
got = subject.select_one(query)
expect(got).to eq("\u0001")
end

it '#select_value' do
got = subject.select_value('SELECT 1 FORMAT RowBinary')
got = subject.select_value(query)
expect(got).to eq("\u0001")
end

it '#summary' do
got = subject.select_all('SELECT 1 FORMAT RowBinary')
got = subject.select_all(query)
expect(got.summary.read_rows).to eq(1)
end

it '#types' do
got = subject.select_all(query)
expect(got.types).to eq([])
end
end

context 'when CSB' do
context 'when CSV' do
let(:query) do
'SELECT 1 FORMAT CSV'
end

it '#select_one' do
got = subject.select_one('SELECT 1 FORMAT CSV')
got = subject.select_one(query)
expect(got).to eq(['1'])
end

it '#select_value' do
got = subject.select_value('SELECT 1 FORMAT CSV')
got = subject.select_value(query)
expect(got).to eq('1')
end

it '#summary' do
got = subject.select_all('SELECT 1 FORMAT CSV')
got = subject.select_all(query)
expect(got.summary.read_rows).to eq(1)
end

it '#types' do
got = subject.select_all(query)
expect(got.types).to eq([])
end
end
end

0 comments on commit 46790bf

Please sign in to comment.