Fix code alignment in specs

This commit is contained in:
Dan Kubb 2013-06-25 00:37:45 -07:00
parent bd912831a8
commit 84e4add8c2
12 changed files with 32 additions and 30 deletions

View file

@ -5,7 +5,7 @@ shared_examples_for 'a method matcher' do
let(:node) { mutation_subject.node }
let(:context) { mutation_subject.context }
let(:mutation_subject) { yields.first }
let(:mutation_subject) { yields.first }
it 'should return one subject' do
yields.size.should be(1)

View file

@ -8,6 +8,7 @@ end
shared_examples_for 'a cli parser' do
subject { cli.config }
its(:filter) { should eql(expected_filter) }
its(:strategy) { should eql(expected_strategy) }
its(:reporter) { should eql(expected_reporter) }
@ -15,9 +16,8 @@ shared_examples_for 'a cli parser' do
end
describe Mutant::CLI, '.new' do
let(:object) { described_class }
let(:time) { Time.now }
let(:time) { Time.now }
before do
Time.stub(:now => time)

View file

@ -13,7 +13,7 @@ describe Mutant::CLI::Classifier, '.build' do
context 'with explicit toplevel scope' do
let(:input) { '::TestApp::Literal#string' }
let(:input) { '::TestApp::Literal#string' }
let(:expected_class) { Mutant::CLI::Classifier::Method }
it_should_behave_like this_spec
@ -21,14 +21,14 @@ describe Mutant::CLI::Classifier, '.build' do
context 'with instance method notation' do
let(:input) { 'TestApp::Literal#string' }
let(:input) { 'TestApp::Literal#string' }
let(:expected_class) { Mutant::CLI::Classifier::Method }
it_should_behave_like this_spec
end
context 'with singleton method notation' do
let(:input) { 'TestApp::Literal.string' }
let(:input) { 'TestApp::Literal.string' }
let(:expected_class) { Mutant::CLI::Classifier::Method }
it_should_behave_like this_spec

View file

@ -4,11 +4,11 @@ describe Mutant::Context::Scope, '#root' do
subject { object.root(node) }
let(:object) { described_class.new(TestApp::Literal, path) }
let(:path) { mock('Path') }
let(:node) { parse(':node') }
let(:path) { mock('Path') }
let(:node) { parse(':node') }
let(:scope) { subject.body }
let(:scope_body) { scope.body }
let(:scope_body) { scope.body }
let(:expected_source) do
generate(parse(<<-RUBY))

View file

@ -5,9 +5,9 @@ describe Mutant::Killer::Rspec, '.new' do
subject { object.new(strategy, mutation) }
let(:strategy) { mock('Strategy', :spec_files => ['foo'], :error_stream => $stderr, :output_stream => $stdout) }
let(:context) { mock('Context') }
let(:mutation) { mock('Mutation', :subject => mutation_subject) }
let(:mutation_subject) { mock('Mutation Subject') }
let(:context) { mock('Context') }
let(:mutation) { mock('Mutation', :subject => mutation_subject) }
let(:mutation_subject) { mock('Mutation Subject') }
let(:object) { described_class }
@ -20,14 +20,16 @@ describe Mutant::Killer::Rspec, '.new' do
context 'when run exits zero' do
let(:exit_status) { 0 }
its(:killed?) { should be(false) }
its(:killed?) { should be(false) }
it { should be_a(described_class) }
end
context 'when run exits nonzero' do
let(:exit_status) { 1 }
its(:killed?) { should be(true) }
its(:killed?) { should be(true) }
it { should be_a(described_class) }
end
end

View file

@ -69,7 +69,7 @@ describe Mutant::Matcher::Method::Instance, '#each' do
def self.bar; end; def bar(arg); end
end
let(:method_line) { 2 }
let(:method_line) { 2 }
let(:method_arity) { 1 }
it_should_behave_like 'a method matcher'
@ -86,8 +86,8 @@ describe Mutant::Matcher::Method::Instance, '#each' do
end
end
let(:method_line) { 3 }
let(:method_name) { :baz }
let(:method_line) { 3 }
let(:method_name) { :baz }
let(:scope) { self.class::Foo::Bar }
it_should_behave_like 'a method matcher'
@ -101,8 +101,8 @@ describe Mutant::Matcher::Method::Instance, '#each' do
end
end
let(:method_line) { 3 }
let(:method_name) { :baz }
let(:method_line) { 3 }
let(:method_name) { :baz }
let(:scope) { self.class::Foo::Bar }
it_should_behave_like 'a method matcher'

View file

@ -2,7 +2,7 @@ require 'spec_helper'
describe Mutant::Matcher::Method::Singleton, '#each' do
let(:object) { described_class.new(scope, method) }
let(:method) { scope.method(method_name) }
let(:method) { scope.method(method_name) }
let(:yields) { [] }
@ -63,8 +63,8 @@ describe Mutant::Matcher::Method::Singleton, '#each' do
def Foo.bar; end
end
let(:method_name) { :bar }
let(:method_line) { 3 }
let(:method_name) { :bar }
let(:method_line) { 3 }
let(:scope) { self.class::Namespace::Foo }
it_should_behave_like 'a method matcher'

View file

@ -26,7 +26,7 @@ describe Mutant::Strategy::Rspec::DM2::Lookup::Method::Instance, '#spec_files' d
end
context 'with public method' do
let(:is_public) { true }
let(:is_public) { true }
let(:expected_glob_expression) { 'spec/unit/foo/expanded_name_spec.rb' }
it_should_behave_like this_example_group

View file

@ -27,14 +27,14 @@ describe Mutant::Strategy::Rspec::DM2::Lookup::Method::Singleton, '#spec_files'
end
context 'with public method' do
let(:is_public) { true }
let(:is_public) { true }
let(:expected_glob_expression) { 'spec/unit/foo/class_methods/expanded_name_spec.rb' }
it_should_behave_like this_example_group
end
context 'with nonpublic method' do
let(:is_public) { false }
let(:is_public) { false }
let(:expected_glob_expression) { 'spec/unit/foo/class_methods/*_spec.rb' }
it_should_behave_like this_example_group

View file

@ -8,8 +8,8 @@ describe Mutant::Subject, '#context' do
end
let(:object) { class_under_test.new(context, node) }
let(:node) { mock('Node') }
let(:context) { mock('Context') }
let(:node) { mock('Node') }
let(:context) { mock('Context') }
it { should be(context) }

View file

@ -1,7 +1,7 @@
require 'spec_helper'
describe Mutant::Subject, '#each' do
subject { object.each { |item| yields << item } }
subject { object.each { |item| yields << item } }
let(:class_under_test) do
Class.new(described_class)

View file

@ -8,8 +8,8 @@ describe Mutant::Subject, '#node' do
end
let(:object) { class_under_test.new(context, node) }
let(:node) { mock('Node') }
let(:context) { mock('Context') }
let(:node) { mock('Node') }
let(:context) { mock('Context') }
it { should be(node) }