-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spec for Converter
#17
Conversation
spec/converter_spec.rb
Outdated
context 'when there is no output' do | ||
context 'and format is csv' do | ||
let(:expected_csv) do | ||
"type,status.status,status.protocol,status.port,status.reason,status.ttl,status.ip,status.timestamp,banner.protocol,banner.port,banner.ip,banner.timestamp,banner.app_protocol,banner.payload\nstatus,open,tcp,80,\"syn,ack\",54,93.184.216.34,2021-08-26 08:50:21 +0200\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to make it multi-line but without adding some unnecessary \n
's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the last newline? You can do either:
<<~CSV.chomp
foo,bar,baz
...
CSV
or
[
"foo,bar,baz",
"..."
].join("\n")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the last one. I don't want this expected_csv
to be too long but saving it as <<CSV.chomp ...
fails when I want to compare it with result of .convert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rebase the branch against main
to get the new spec/fixtures/converters/input.json
file. Also I think we need an input.csv
file as well so we can test input_format: :csv
.
spec/fixtures/converter/masscan.json
Outdated
@@ -0,0 +1,3 @@ | |||
[ | |||
{ "ip": "93.184.216.34", "timestamp": "1629960621", "ports": [ {"port": 80, "proto": "tcp", "status": "open", "reason": "syn-ack", "ttl": 54} ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rebase this branch to get the new spec/fixtures/converter/input.json
.
a22b72e
to
14d5bf6
Compare
I'll add it later. |
Make the spec variables more consistent.
#1