Skip to content

Commit

Permalink
Fix Ruby warnings
Browse files Browse the repository at this point in the history
MSP-12656

spec_helper enables Ruby warnings now, so fix those under this project's
control.
  • Loading branch information
limhoff-r7 committed Apr 30, 2015
1 parent 8e77c96 commit bb2348d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/app/models/metasploit/model/search/query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@

it 'should have same operator for each child of a union' do
children.each do |child|
operator_set = child.children.inject(Set.new) { |operator_set, operation|
operator_set.add operation.operator
operator_set = child.children.inject(Set.new) { |block_operator_set, operation|
block_operator_set.add operation.operator
}

expect(operator_set.length).to eq(1)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/metasploit/model/nilify_blanks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
it 'should support adding multiple attributes' do
attributes = [:a, :b]

base_class.nilify_blank *attributes
base_class.nilify_blank(*attributes)

attributes.each do |attribute|
expect(base_class.nilify_blank_attribute_set).to include(attribute)
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/metasploit/model/search/association_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

context 'search_associations' do
subject(:search_associations) {
base_class.search_associations *associations
base_class.search_associations(*associations)
}

let(:associations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
expect {
call
}.to raise_error(converted_exception.class) do |actual_exception|
actual_exception.class == converted_exception.class
expect(actual_exception.class).to eq(converted_exception.class)
expect(actual_exception.key).to eq(converted_exception.key)
expect(actual_exception.locale).to eq(converted_exception.locale)
expect(actual_exception.options).to eq(converted_exception.options)
Expand Down
6 changes: 5 additions & 1 deletion spec/lib/metasploit/model/spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@
expect {
described_class.temporary_pathname = temporary_pathname
}.to change {
described_class.instance_variable_get(:@temporary_pathname)
if described_class.instance_variable_defined? :@temporary_pathname
described_class.instance_variable_get(:@temporary_pathname)
else
nil
end
}.to(temporary_pathname)
end
end
Expand Down

0 comments on commit bb2348d

Please sign in to comment.