spec/app/models/metasploit/model/search/query_spec.rb in metasploit-model-1.0.2 vs spec/app/models/metasploit/model/search/query_spec.rb in metasploit-model-1.1.0

- old
+ new

@@ -16,11 +16,11 @@ :formatted => formatted, :klass => klass ) end - before(:each) do + before(:example) do stub_const('Queried', klass) # include after stubbing constant so that Class#name can be used for search_i18n_scope klass.send(:include, Metasploit::Model::Search) end @@ -31,11 +31,11 @@ 'metasploit.model.errors.models.metasploit/model/search/query.attributes.operations.too_short', :count => 1 ) end - before(:each) do + before(:example) do query.valid? end context 'with empty' do let(:formatted) do @@ -69,11 +69,11 @@ let(:query) do described_class.new end - before(:each) do + before(:example) do operation = double('Invalid Operation', :valid? => valid) allow(query).to receive(:operations).and_return([operation]) end context 'with invalid operation' do @@ -196,11 +196,11 @@ formatted: formatted, klass: klass ) end - before(:each) do + before(:example) do stub_const('QueriedClass', klass) # include after stubbing const so that search_i18n_scope can use Class#name klass.send(:include, Metasploit::Model::Search) end @@ -260,11 +260,11 @@ :formatted => formatted, :klass => klass ) end - before(:each) do + before(:example) do stub_const('QueriedClass', klass) # include after stubbing const so that search_i18n_scope can use Class#name klass.send(:include, Metasploit::Model::Search) end @@ -286,11 +286,11 @@ let(:formatted_value) do '' end - before(:each) do + before(:example) do @operator = klass.search_attribute attribute, :type => type end context 'with boolean operator' do let(:type) do @@ -439,11 +439,11 @@ :formatted => formatted, :klass => klass ) end - before(:each) do + before(:example) do stub_const('Queried', klass) klass.send(:include, Metasploit::Model::Search) @operators = [:first, :second].collect { |attribute| @@ -523,11 +523,11 @@ described_class.new( :klass => klass ) end - before(:each) do + before(:example) do stub_const('QueriedClass', klass) # include after stubbing const so that search_i18n_scope can use Class#name klass.send(:include, Metasploit::Model::Search) @operator = klass.search_attribute attribute, :type => :string @@ -582,11 +582,11 @@ :formatted => formatted, :klass => klass ) end - before(:each) do + before(:example) do stub_const('Queried', klass) klass.send(:include, Metasploit::Model::Search) klass.search_attribute :thing_one, :type => :string klass.search_attribute :thing_two, :type => :string @@ -683,10 +683,10 @@ # # Callbacks # - before(:each) do + before(:example) do stub_const('Queried', klass) klass.send(:include, Metasploit::Model::Search) end \ No newline at end of file