Sha256: b07c251520d444e0421a861f428c822bf54bdbb545967e755158a6cb109e02a9

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

describe "Running a RSpec Unit Test" do
  before(:all) do
    # While it doesn't cause these tests to fail, nasty messages occur (and more)
    # when either a ~/.netrc entry or file itself doesn't exist. This aims to correct that,
    # and will only ever be called once.

    LearnTest::UsernameParser.get_username
  end

  context 'a basic rspec unit test' do
    it 'runs the spec with 0 failures' do
      output = `cd ./spec/fixtures/rspec-unit-spec && ./../../../bin/learn-test --local --test`

      expect(output).to include('3 examples, 0 failures')
      expect(output).to_not include('1 failures')
    end
  end

  context 'with the --example flag' do
    it 'runs only the appropriate tests' do
      output = `cd ./spec/fixtures/rspec-unit-spec && ./../../../bin/learn-test --local --test --example multiple`

      expect(output).to include('1 example, 0 failures')
      expect(output).to_not include('2 examples')
    end

     it 'accepts multiple examples' do
      output = `cd ./spec/fixtures/rspec-unit-spec && ./../../../bin/learn-test --local --test --example multiple --example accepts`

      expect(output).to include('2 examples, 0 failures')
      expect(output).to_not include('3 examples')
      expect(output).to_not include('1 example')
    end 
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
learn-test-3.1.2 spec/features/rspec_unit_spec.rb
learn-test-3.1.1 spec/features/rspec_unit_spec.rb
learn-test-3.1.0 spec/features/rspec_unit_spec.rb
learn-test-3.0.0 spec/features/rspec_unit_spec.rb
learn-test-2.7.0 spec/features/rspec_unit_spec.rb