Skip to content

Commit 98fb7ec

Browse files
author
Tom Johnson
committed
Test default false graph name
We don't want transactions to overwrite `false` graph names.
1 parent 13cffbe commit 98fb7ec

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

lib/rdf/spec/transaction.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,27 @@
127127
expect(subject.repository).not_to have_statement(with_name)
128128
expect(subject.repository).to have_statement(st)
129129
end
130+
131+
it 'retains existing graph names' do
132+
st.graph_name = RDF::URI('g')
133+
repository.insert(st)
134+
135+
expect do
136+
subject.delete(st)
137+
subject.execute
138+
end.to change { subject.repository.statements }.to be_empty
139+
end
140+
141+
it 'retains existing default graph name' do
142+
st.graph_name = false
143+
144+
repository.insert(st)
145+
146+
expect do
147+
subject.delete(st)
148+
subject.execute
149+
end.to change { subject.repository.statements }.to be_empty
150+
end
130151
end
131152
end
132153

@@ -189,6 +210,17 @@
189210

190211
expect(subject.repository).to have_statement(st)
191212
end
213+
214+
it 'retains existing default graph name' do
215+
st.graph_name = false
216+
217+
expect do
218+
subject.insert(st)
219+
subject.execute
220+
end.to change { subject.repository.statements }
221+
222+
expect(subject.repository).to have_statement(st)
223+
end
192224
end
193225
end
194226

0 commit comments

Comments
 (0)