Search code examples
ruby-on-railsrspecrspec-rails

RSpec not outputting the statements passed to "it"


I have a Rails 5 api-only app and recently added RSpec to it. Whenever I run rspec spec/models/user_spec.rb, it passes but doesn't output the description of the text.

Here's a sample user_spec.rb file:

require 'rails_helper'

RSpec.describe "something" do
  it "does something" do
  end
end

Here's the output:

$ rspec spec/models/user_spec.rb 
.

Finished in 0.0029 seconds (files took 2.38 seconds to load)
1 example, 0 failures

I would expect the output to show "does something" etc. Any idea what's going on?


Solution

  • This is normal behaviour, but you can try

    rspec <file> --format documentation