Sha256: e5f38d98ee09fcf9afbe67025eb3f3acbbee87d3d0932dedf6323674355818e2
Contents?: true
Size: 1.7 KB
Versions: 10
Compression:
Stored size: 1.7 KB
Contents
require 'spec' require 'bolt/runners/rspec' describe Bolt::Runners::RSpec 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 == ['spec/controllers/test_controller_spec.rb'] end it 'should translate models' do @runner.stub('file_verified?').and_return(true) @runner.translate('app/models/test.rb').should == ['spec/models/test_spec.rb'] end it 'should translate views' do @runner.stub('file_verified?').and_return(true) @runner.translate('app/views/test/test.html.erb').should == ['spec/controllers/test_controller_spec.rb'] end it 'should translate lib' do @runner.stub('file_verified?').and_return(true) @runner.translate('lib/test.rb').should == ['spec/test_spec.rb'] end it 'should translate lib with subfolders' do @runner.stub('file_verified?').and_return(true) @runner.translate('lib/testing/test.rb').should == ['spec/testing/test_spec.rb'] end it 'should translate specs to themselves' do @runner.stub('file_verified?').and_return(true) @runner.translate('spec/controllers/test_controller_spec.rb').should == ['spec/controllers/test_controller_spec.rb'] @runner.translate('spec/test_spec.rb').should == ['spec/test_spec.rb'] @runner.translate('spec/testing/test_spec.rb').should == ['spec/testing/test_spec.rb'] end it 'should return no results if file is not present' do b = StringIO.new $stdout, old = b, $stdout @runner.stub('file_verified?').and_return(false) @runner.translate('lib/testing/test.rb').should == [] $stdout = old end end
Version data entries
10 entries across 10 versions & 1 rubygems