spec/lib/metasploit/model/engine_spec.rb in metasploit-model-0.30.2-java vs spec/lib/metasploit/model/engine_spec.rb in metasploit-model-1.0.0.pre.rails.pre.4.0

- old
+ new

@@ -1,6 +1,8 @@ -RSpec.describe Metasploit::Model::Engine do +require 'spec_helper' + +describe Metasploit::Model::Engine do context 'config' do subject(:config) do described_class.config end @@ -17,69 +19,30 @@ context 'factory_girl' do subject(:factory_girl) do options[:factory_girl] end - context 'dir' do - subject(:dir) { - factory_girl[:dir] - } - - it { is_expected.to eq('spec/factories') } - end + its([:dir]) { should == 'spec/factories' } end context 'rails' do subject(:rails) do options[:rails] end - context 'assets' do - subject(:assets) { - rails[:assets] - } - - it { is_expected.to eq(false) } - end - - context 'fixture_replacement' do - subject(:fixture_replacement) { - rails[:fixture_replacement] - } - - it { is_expected.to eq(:factory_girl) } - end - - context 'helper' do - subject(:helper) { - rails[:helper] - } - - it { is_expected.to eq(false) } - end - - context 'test_framework' do - subject(:test_framework) { - rails[:test_framework] - } - - it { is_expected.to eq(:rspec) } - end + its([:assets]) { should be_false } + its([:fixture_replacement]) { should == :factory_girl } + its([:helper]) { should be_false } + its([:test_framework]) { should == :rspec } end context 'rspec' do subject(:rspec) do options[:rspec] end - context 'fixture' do - subject(:fixture) { - rspec[:fixture] - } - - it { is_expected.to eq(false) } - end + its([:fixture]) { should be_false } end end end end @@ -96,11 +59,11 @@ initializer.name == 'metasploit-model.prepend_factory_path' } end it 'should run after factory_girl.set_factory_paths' do - expect(initializer.after).to eq('factory_girl.set_factory_paths') + initializer.after.should == 'factory_girl.set_factory_paths' end context 'running' do def run initializer.run @@ -108,10 +71,10 @@ context 'with FactoryGirl defined' do it 'should prepend full path to spec/factories to FactoryGirl.definition_file_paths' do definition_file_path = Metasploit::Model::Engine.root.join('spec', 'factories') - expect(FactoryGirl.definition_file_paths).to receive(:unshift).with(definition_file_path) + FactoryGirl.definition_file_paths.should_receive(:unshift).with(definition_file_path) run end end end \ No newline at end of file