Skip to content

Commit 86b9763

Browse files
committed
Simplify specs for security engine result and runner
1 parent dce9cca commit 86b9763

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spec/datadog/appsec/security_engine/result_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
it { expect(result.derivatives).to eq({'3' => '3'}) }
2424
it { expect(result.duration_ns).to eq(400) }
2525
it { expect(result.duration_ext_ns).to eq(500) }
26-
it { expect(result.input_truncated?).to eq(false) }
26+
it { expect(result).not_to be_input_truncated }
2727
end
2828

2929
context 'when initializing error result' do
@@ -35,7 +35,7 @@
3535
it { expect(result.derivatives).to eq({}) }
3636
it { expect(result.duration_ns).to eq(0) }
3737
it { expect(result.duration_ext_ns).to eq(100) }
38-
it { expect(result.input_truncated?).to eq(false) }
38+
it { expect(result).not_to be_input_truncated }
3939
end
4040
end
4141

spec/datadog/appsec/security_engine/runner_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
expect(result.derivatives).to eq({})
107107
expect(result.duration_ns).to eq(10)
108108
expect(result.duration_ext_ns).to be > result.duration_ns
109-
expect(result.input_truncated?).to be false
109+
expect(result).not_to be_input_truncated
110110
end
111111

112112
context 'when WAF::Result#input_truncated? is true' do
@@ -126,7 +126,7 @@
126126
end
127127

128128
it 'returns result with input_trucnated set to true' do
129-
expect(result.input_truncated?).to be true
129+
expect(result).to be_input_truncated
130130
end
131131
end
132132
end
@@ -160,7 +160,7 @@
160160
expect(result.derivatives).to eq({})
161161
expect(result.duration_ns).to eq(100)
162162
expect(result.duration_ext_ns).to be > result.duration_ns
163-
expect(result.input_truncated?).to be false
163+
expect(result).not_to be_input_truncated
164164
end
165165

166166
context 'when WAF::Result#input_truncated? is true' do
@@ -172,7 +172,7 @@
172172
end
173173

174174
it 'returns result with input_trucnated set to true' do
175-
expect(result.input_truncated?).to be true
175+
expect(result).to be_input_truncated
176176
end
177177
end
178178
end
@@ -205,7 +205,7 @@
205205
end
206206

207207
it 'returns result with input_trucnated set to true' do
208-
expect(waf_result.input_truncated?).to be true
208+
expect(waf_result).to be_input_truncated
209209
end
210210
end
211211
end
@@ -228,7 +228,7 @@
228228

229229
expect(run_result).to be_kind_of(Datadog::AppSec::SecurityEngine::Result::Error)
230230
expect(run_result.duration_ext_ns).to be > 0
231-
expect(run_result.input_truncated?).to be false
231+
expect(run_result).not_to be_input_truncated
232232
end
233233
end
234234
end

0 commit comments

Comments
 (0)