# encoding: utf-8 require 'spec_helper' describe RspecRunner do context '#initialize' do it 'accepts a config' do config = double('config') allow(config).to receive(:fetch) expect { RspecRunner.new(config) }.not_to raise_error end end context '#to_s' do it 'returns command string' do runner = RspecRunner.new(test_cases_directory: working_directory) expect(runner.to_s).to eq('--color --format Fuubar --order rand') end it 'uses tag if given' do runner = RspecRunner.new(test_cases_directory: working_directory, tags: 'my_tag') expect(runner.to_s).to eq('--color --format Fuubar --order rand --tag my_tag') end it 'uses multiple tags if given' do runner = RspecRunner.new(test_cases_directory: working_directory, tags: ['my_tag', 'new_tag']) expect(runner.to_s).to eq('--color --format Fuubar --order rand --tag my_tag --tag new_tag') end end #context '#run' do # it 'runs test' do # create_file 'test_rspec_runner_spec.rb', <<-EOS.strip_heredoc # describe 'Test' do # it 'is true' do # expect(true).to be true # end # end # EOS # runner = RspecRunner.new(test_cases_directory: working_directory) # runner.run # end #end end