Nerian
Nerian

Reputation: 16197

How to customise Rspec document format

When I do rspec spec I get a report of the tests in this way:

Course Group
  Loged in
    In the new course group form
      Create a new Group course
      Create a new Group course with complex name (FAILED - 1)
      Create a new Group course with 3 subjects (FAILED - 2)

1) Course Group Loged in In the new course group form Create a new Group course with complex name
     Failure/Error: course_groupDB.courses.count.should == 1
       expected: 1
            got: 0 (using ==)
     # ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'

2) Course Group Loged in In the new course group form Create a new Group course with 3 subjects
     Failure/Error: course_groupDB.courses.count.should == 3
       expected: 3
            got: 0 (using ==)
     # ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>'

Notice the at the end, when failures are listed, the name is quite messy, as it mix all the contexts, describes and examples.

Is there a way to just shown it the same way they are listed before?

Like this:

1) Course Group 
   Loged in 
         In the new course group form 
            Create a new Group course with complex name
                Failure/Error: course_groupDB.courses.count.should == 1
                       expected: 1
                            got: 0 (using ==)
                     # ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'

  2) Course Group 
     Loged in 
        In the new course group form 
            Create a new Group course with 3 subjects
                Failure/Error: course_groupDB.courses.count.should == 3
                           expected: 3
                                got: 0 (using ==)
                         # ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>'

Upvotes: 0

Views: 223

Answers (1)

Nerian
Nerian

Reputation: 16197

I finally end up using Fuubar

https://github.com/jeffkreeftmeijer/fuubar

It does not fully fill my needs, but it a good starter.

Upvotes: 2

Related Questions