Skip to content

Commit 8dd926b

Browse files
committed
[Ruby-Tips] Remove RSpec output limit
1 parent cae7878 commit 8dd926b

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

content/ruby-tips-and-tricks.org

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
:PROPERTIES:
33
:CUSTOM_ID: page.title
44
:END:
5-
** Rapidly Compute the CIDR Range
5+
6+
** General
7+
8+
*** Rapidly Compute the CIDR Range
69
:PROPERTIES:
710
:CUSTOM_ID: rapidly-compute-the-cidr-range
811
:END:
@@ -21,3 +24,20 @@ To check whether an IP address belongs to the range:
2124
irb(main):003> IPAddr.new("10.101.64.0/18") === "127.0.0.2"
2225
=> false
2326
#+end_example
27+
28+
** RSpec
29+
30+
*** Debugging a Failing Expectation
31+
32+
When a spec is failing, the displayed error cause is
33+
truncated. Sometimes, it makes it difficult to understand what
34+
happened.
35+
36+
To solve this, RSpec provides a way to control the length of the
37+
output:
38+
39+
#+begin_src ruby
40+
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = 2000
41+
#+end_src
42+
43+
Setting this to =nil= will not limit the output.

0 commit comments

Comments
 (0)