Skip to content

Instantly share code, notes, and snippets.

@askl56
Created November 9, 2015 21:18
Show Gist options
  • Save askl56/389c6dfe07be6060be71 to your computer and use it in GitHub Desktop.
Save askl56/389c6dfe07be6060be71 to your computer and use it in GitHub Desktop.
1) Counter outputs the 'File checked' output
Failure/Error: expect { subject.call }.to output("File checked: test_files/test-1.txt").to_stdout
expected block to output "File checked: test_files/test-1.txt" to stdout, but output "File checked: test_files/another-test.txt\nRange: 1000..10000\nPalindromes: 90\n========================\n\nFile checked: test_files/example.txt\nRange: 1..100\nPalindromes: 18\n========================\n\nFile checked: test_files/test-1.txt\nRange: 1034567..2888888\nPalindromes: 1854\n========================\n\nFile checked: test_files/test-2.txt\nRange: 11200000..11300000\nPalindromes: 10\n========================\n\n"
Diff:
@@ -1,2 +1,20 @@
+File checked: test_files/another-test.txt
+Range: 1000..10000
+Palindromes: 90
+========================
+
+File checked: test_files/example.txt
+Range: 1..100
+Palindromes: 18
+========================
+
File checked: test_files/test-1.txt
+Range: 1034567..2888888
+Palindromes: 1854
+========================
+
+File checked: test_files/test-2.txt
+Range: 11200000..11300000
+Palindromes: 10
+========================
# ./spec/counter_spec.rb:8:in `block (2 levels) in <top (required)>'
Finished in 1.16 seconds (files took 1.2 seconds to load)
1 example, 1 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment