Sha256: 7f6e6389a8b30690a8037c967ca9f1d7ade4542e84b83435c0a198994582bbb0

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

require 'spec'
require 'bolt/runners/test_unit'

describe Bolt::Runners::TestUnit do
  
  before(:all) do
    @runner = described_class.new
  end
  
  it 'should translate controllers' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('app/controllers/test_controller.rb').should == ['test/functional/test_controller_test.rb']
  end
  
  it 'should translate models' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('app/models/test.rb').should == ['test/unit/test_test.rb']
  end
  
  it 'should translate views' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('app/views/test/test.html.erb').should == ['test/functional/test_controller_test.rb']
  end
  
  it 'should translate lib' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('lib/test.rb').should == ['test/unit/test_test.rb']
  end
  
  it 'should translate lib with subfolders' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('lib/testing/test.rb').should == ['test/unit/testing/test_test.rb']
  end
  
  it 'should translate tests to itself' do
    @runner.stub('file_verified?').and_return(true)
    @runner.translate('test/functional/test_controller_test.rb').should == ['test/functional/test_controller_test.rb']
    @runner.translate('test/unit/test_test.rb').should == ['test/unit/test_test.rb']
    @runner.translate('test/unit/testing/test_test.rb').should == ['test/unit/testing/test_test.rb']
  end
  
  it 'should return no results if file is not present' do
    @runner.stub('file_verified?').and_return(false)
    @runner.translate('lib/testing/test.rb').should == []
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
marcinbunsch-bolt-0.1.0 spec/bolt/runners/test_unit_spec.rb
marcinbunsch-bolt-0.1.4 spec/bolt/runners/test_unit_spec.rb
marcinbunsch-bolt-0.1.6 spec/bolt/runners/test_unit_spec.rb
marcinbunsch-bolt-0.1.7 spec/bolt/runners/test_unit_spec.rb
marcinbunsch-bolt-0.1.8 spec/bolt/runners/test_unit_spec.rb
marcinbunsch-bolt-0.1.9 spec/bolt/runners/test_unit_spec.rb