vim-rspec icon indicating copy to clipboard operation
vim-rspec copied to clipboard

Test report for an almost empty spec file displays '3 passed'

Open bankair opened this issue 9 years ago • 1 comments

Environment

  • vim-rspec version: last available one (cf7eb2fe54d5adf5dcc0a13d680ab4820765d520)
  • rspec version: 3.2.3
  • vim version: NVIM 0.0.0-alpha+201504141749 (compiled Apr 15 2015 11:57:57)

Description

Let's imagine I'm using an almost empty file like so:

class Foo
  def answer
    42
  end
end

describe Foo do
  describe '#answer' do
  end
end

When executing :RunSpec on the file, the result is:


+-- 3 passed --------------------------------------------------
Finished in 0.00015 seconds

Damn !?! 3 tests passed ? where does that come from ? Let's expand the result report:


++++++++++++++++++++++++++++++
+ PASS: All 0 Specs Pass!
++++++++++++++++++++++++++++++
Finished in 0.00015 seconds

Seems like 3 lines -> 3 passed

bankair avatar Jul 01 '15 07:07 bankair

The very same thing happen if a add a single test:

class Foo
  def answer
    42
  end
end

describe Foo do
  let (:instance) { Foo.new }
  describe '#answer' do
    it { expect( instance.answer ).to eq 42 }
  end
end

The result being:


+-- 3 passed --------------------------------------------------
Finished in 0.00088 seconds

[Foo]

[#answer]
+ should eq 42

Which expand to:


++++++++++++++++++++++++++++++
+ PASS: All 1 Specs Pass!
++++++++++++++++++++++++++++++
Finished in 0.00088 seconds

[Foo]

[#answer]
+ should eq 42

Could be related to rpsec 3.2.3 output format, then ?

bankair avatar Jul 01 '15 07:07 bankair