Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created January 23, 2016 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myronmarston/f38a7273ac000b544d28 to your computer and use it in GitHub Desktop.
Save myronmarston/f38a7273ac000b544d28 to your computer and use it in GitHub Desktop.
A group of examples
 passes
 is pending (PENDING: not yet passing)
 fails (FAILED - 1)
 fails with a diff (FAILED - 2)
 fails with a multiline snippet in order to show off syntax highlighting (FAILED - 3)
Pending: (Failures listed here are expected and do not affect your suite's status)
1) A group of examples is pending
# not yet passing
Failure/Error: expect(1).to eq(2)

 expected: 2
 got: 1

 (compared using ==)
# ./spec/example_spec.rb:8:in `block (2 levels) in <top (required)>'
Failures:
1) A group of examples fails
Failure/Error: expect(1).to eq(2)

 expected: 2
 got: 1

 (compared using ==)
# ./spec/example_spec.rb:12:in `block (2 levels) in <top (required)>'
2) A group of examples fails with a diff
Failure/Error: expect("foo\nbar").to eq("foo\nbas")

 expected: "foo\nbas"
 got: "foo\nbar"

 (compared using ==)

 Diff:
 @@ -1,3 +1,3 @@
  foo
 -bas
 +bar
 
# ./spec/example_spec.rb:16:in `block (2 levels) in <top (required)>'
3) A group of examples fails with a multiline snippet in order to show off syntax highlighting
Failure/Error:
 expect {
 SomeModule::SomeClass.some_method(:some, "args", 1, 2) if true
 }.to raise_error(ArgumentError)

 expected ArgumentError, got #<NameError: uninitialized constant SomeModule> with backtrace:
 # ./spec/example_spec.rb:21:in `block (3 levels) in <top (required)>'
 # ./spec/example_spec.rb:20:in `block (2 levels) in <top (required)>'
# ./spec/example_spec.rb:20:in `block (2 levels) in <top (required)>'
Finished in 0.01379 seconds (files took 0.10819 seconds to load)
5 examples, 3 failures, 1 pending
Failed examples:
rspec ./spec/example_spec.rb:11 # A group of examples fails
rspec ./spec/example_spec.rb:15 # A group of examples fails with a diff
rspec ./spec/example_spec.rb:19 # A group of examples fails with a multiline snippet in order to show off syntax highlighting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment