Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor style tweaks.

  • Loading branch information...
commit 9565ddd0f4ea1024f86f75ff4f68fab875c39ec2 1 parent a117db9
@readeharris readeharris authored drapergeek committed
View
14 lib/shoulda/matchers/independent/delegate_matcher.rb
@@ -5,8 +5,8 @@ module Independent # :nodoc:
# Ensure that a given method is delegated properly.
#
# Dependencies:
- # This matcher requires the `bourne` gem be added to your Gemfile. You will receive
- # a warning if this is not the case.
+ # This matcher requires the `bourne` gem be added to your Gemfile. You will receive
+ # a warning if this is not the case.
#
# Basic Syntax:
# it { should delegate_method(:deliver_mail).to(:mailman) }
@@ -17,7 +17,7 @@ module Independent # :nodoc:
#
# Examples:
# it { should delegate_method(:deliver_mail).to(:mailman).as(:deliver_with_haste)
- # it { should delegate_method(:deliver_mail).to(:mailman).with_arguments("221B Baker St.", :hastily => true)
+ # it { should delegate_method(:deliver_mail).to(:mailman).with_arguments('221B Baker St.', :hastily => true)
#
def delegate_method(delegating_method)
require 'bourne'
@@ -96,9 +96,9 @@ def target_method_name
def method_name_with_class(method)
if Class === @subject
- @subject.name + "." + method.to_s
+ @subject.name + '.' + method.to_s
else
- @subject.class.name + "#" + method.to_s
+ @subject.class.name + '#' + method.to_s
end
end
@@ -115,13 +115,13 @@ def ensure_target_method_is_present!
class DelegateMatcher::TargetNotDefinedError < StandardError
def message
- "Delegation needs a target. Use the #to method to define one, e.g. `post_office.should delegate(:deliver_mail).to(:mailman)`"
+ 'Delegation needs a target. Use the #to method to define one, e.g. `post_office.should delegate(:deliver_mail).to(:mailman)`'
end
end
class DelegateMatcher::InvalidDelegateMatcher < StandardError
def message
- "#delegate_to does not support #should_not syntax."
+ '#delegate_to does not support #should_not syntax.'
end
end
end
View
12 spec/shoulda/independent/delegate_matcher_spec.rb
@@ -85,7 +85,7 @@ def mailman
define_class(:mailman)
define_class(:post_office) do
def deliver_mail
- mailman.deliver_mail("221B Baker St.", hastily: true)
+ mailman.deliver_mail('221B Baker St.', hastily: true)
end
def mailman
@@ -97,7 +97,7 @@ def mailman
context 'when given the correct arguments' do
it 'matches' do
post_office = PostOffice.new
- matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments("221B Baker St.", hastily: true)
+ matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments('221B Baker St.', hastily: true)
post_office.should matcher
end
end
@@ -105,13 +105,13 @@ def mailman
context 'when not given the correct arguments' do
it 'does not match' do
post_office = PostOffice.new
- matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments("123 Nowhere Ln.")
+ matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments('123 Nowhere Ln.')
matcher.matches?(post_office).should be_false
end
it 'has a failure message that indicates which arguments were expected' do
post_office = PostOffice.new
- matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments("123 Nowhere Ln.")
+ matcher = delegate_method(:deliver_mail).to(:mailman).with_arguments('123 Nowhere Ln.')
matcher.matches?(post_office)
matcher.failure_message.should == 'Expected PostOffice#deliver_mail to delegate to PostOffice#mailman with arguments: ["123 Nowhere Ln."]'
end
@@ -160,13 +160,13 @@ def mailman
describe Shoulda::Matchers::Independent::DelegateMatcher::TargetNotDefinedError do
it 'has a useful message' do
error = Shoulda::Matchers::Independent::DelegateMatcher::TargetNotDefinedError.new
- error.message.should include "Delegation needs a target."
+ error.message.should include 'Delegation needs a target'
end
end
describe Shoulda::Matchers::Independent::DelegateMatcher::InvalidDelegateMatcher do
it 'has a useful message' do
error = Shoulda::Matchers::Independent::DelegateMatcher::InvalidDelegateMatcher.new
- error.message.should include "does not support #should_not"
+ error.message.should include 'does not support #should_not'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.