Permalink
Browse files

Fix ruby warnings.

- lib/rspec/core/shared_example_group.rb:41: warning: `&' interpreted as argument prefix
- spec/rspec/core/configuration_spec.rb:86: warning: ambiguous first argument; put parentheses or even spaces
- spec/rspec/core/configuration_spec.rb:182: warning: ambiguous first argument; put parentheses or even spaces
- spec/rspec/core/option_parser_spec.rb:71: warning: possibly useless use of == in void context

Closes #645.
  • Loading branch information...
1 parent f9ed7ab commit 1f78187521d9d9d931df5560574db5654b20512a @myronmarston myronmarston committed Jul 11, 2012
View
2 lib/rspec/core/shared_example_group.rb
@@ -38,7 +38,7 @@ def shared_examples *args, &block
unless args.empty?
mod = Module.new
(class << mod; self; end).send :define_method, :extended do |host|
- host.class_eval &block
+ host.class_eval(&block)
end
RSpec.configuration.extend mod, *args
end
View
4 spec/rspec/core/configuration_spec.rb
@@ -83,7 +83,7 @@ module RSpec::Core
lambda do
config.send m, mod do |mod_config|
end
- end.should raise_error /must respond to `configuration`/
+ end.should raise_error(/must respond to `configuration`/)
end
end
@@ -179,7 +179,7 @@ module RSpec::Core
lambda do
config.expect_with :rspec, :stdlib do |mod_config|
end
- end.should raise_error /expect_with only accepts/
+ end.should raise_error(/expect_with only accepts/)
end
it "raises ArgumentError if framework is not supported" do
View
2 spec/rspec/core/option_parser_spec.rb
@@ -68,7 +68,7 @@ module RSpec::Core
describe option do
it "escapes the arg" do
options = Parser.parse!([option, "this (and that)"])
- options[:full_description].length.should == 1
+ options[:full_description].length.should eq(1)
"this (and that)".should match(options[:full_description].first)
end
end

0 comments on commit 1f78187

Please sign in to comment.