Skip to content

Commit

Permalink
Add several occurrences smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
sl4vr committed Sep 14, 2020
1 parent e2f2cca commit 701f9ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions specs/smoke_tests/dummy/test.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
wubba.lubba:
dub.dub: bar
test:
duplicate: true
1 change: 1 addition & 0 deletions specs/smoke_tests/dummy/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ top:
test:
key: foo
key2: bar
duplicate: true
foo: bar
8 changes: 8 additions & 0 deletions specs/smoke_tests/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
end
end

it 'searches correctly for several occurrences' do
assert_output(
%r{dummy/test\.yml:7:14\ntrue\n\n.+dummy/test\.yaml:4:14\ntrue}
) do
Yamlook::Search.perform(%w[test duplicate])
end
end

it 'outputs that nothing found if nothing found' do
assert_output(/Nothing found./) do
Yamlook::Search.perform(%w[no such key])
Expand Down

0 comments on commit 701f9ce

Please sign in to comment.