spec/inspector_spec.rb in guillaumegentil-rspactor-0.3.4 vs spec/inspector_spec.rb in guillaumegentil-rspactor-0.4

- old
+ new

@@ -51,21 +51,25 @@ it "should handle files without extension" do translate('foo').should == ['/project/spec/foo_spec.rb'] end it "should consider all controllers, helpers and views when routes.rb changes" do - translate('config/routes.rb').should == ['/project/spec/controllers', '/project/spec/helpers', '/project/spec/views'] + translate('config/routes.rb').should == ['/project/spec/controllers', '/project/spec/helpers', '/project/spec/views', '/project/spec/routing'] end it "should consider all models when config/database.yml changes" do translate('config/database.yml').should == ['/project/spec/models'] end it "should consider all models when db/schema.rb changes" do translate('db/schema.rb').should == ['/project/spec/models'] end + it "should consider all models when spec/factories.rb changes" do + translate('spec/factories.rb').should == ['/project/spec/models'] + end + it "should consider related model when its observer changes" do translate('app/models/user_observer.rb').should == ['/project/spec/models/user_observer_spec.rb', '/project/spec/models/user_spec.rb'] end it "should consider all specs when spec_helper changes" do @@ -79,14 +83,21 @@ it "should consider all specs when app configuration changes" do translate('config/environment.rb').should == ['/project/spec'] translate('config/environments/test.rb').should == ['/project/spec'] translate('config/boot.rb').should == ['/project/spec'] end + + it "should consider cucumber when a features file change" do + translate('features/login.feature').should == ['cucumber'] + translate('features/steps/webrat_steps.rb').should == ['cucumber'] + translate('features/support/env.rb').should == ['cucumber'] + end + end - describe "#determine_spec_files" do + describe "#determine_files" do def determine(file) - @inspector.determine_spec_files(file) + @inspector.determine_files(file) end it "should filter out files that don't exist on the filesystem" do @inspector.should_receive(:translate).with('foo').and_return(%w(valid_spec.rb invalid_spec.rb)) File.should_receive(:exists?).with('valid_spec.rb').and_return(true) \ No newline at end of file