make specs order independed

This commit is contained in:
Vasiliy Ermolovich 2012-06-09 02:14:48 +03:00
parent 5129026d42
commit f42ec0a287
3 changed files with 7 additions and 2 deletions

1
.rspec
View File

@ -1 +1,2 @@
--color
--order rand

View File

@ -712,10 +712,10 @@ describe Draper::Base do
end
context "when #hello_world is called again" do
before { subject.hello_world }
it "proxies method directly after first hit" do
subject.should_not_receive(:method_missing)
subject.methods.should_not include(:hello_world)
subject.hello_world
subject.methods.should include(:hello_world)
end
end

View File

@ -45,6 +45,10 @@ describe Rails::Generators::DecoratorGenerator do
run_generator ["YourModel"]
end
after do
Object.send(:remove_const, :ApplicationDecorator)
end
subject { file('app/decorators/your_model_decorator.rb') }
it { should exist }
it { should contain "class YourModelDecorator < ApplicationDecorator" }