Skip to content

Commit

Permalink
swaping order of assert_equal arguments where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed May 26, 2011
1 parent 37144d3 commit 6c97d04
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/delegator_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ def method_missing(*a, &b)
def self.delegates(name) def self.delegates(name)
it "delegates #{name}" do it "delegates #{name}" do
m = mirror { send name } m = mirror { send name }
assert_equal m.last_call, [name.to_s] assert_equal [name.to_s], m.last_call
end end


it "delegates #{name} with arguments" do it "delegates #{name} with arguments" do
m = mirror { send name, "foo", "bar" } m = mirror { send name, "foo", "bar" }
assert_equal m.last_call, [name.to_s, "foo", "bar"] assert_equal [name.to_s, "foo", "bar"], m.last_call
end end


it "delegates #{name} with block" do it "delegates #{name} with block" do
block = proc { } block = proc { }
m = mirror { send(name, &block) } m = mirror { send(name, &block) }
assert_equal m.last_call, [name.to_s, block] assert_equal [name.to_s, block], m.last_call
end end
end end


Expand Down Expand Up @@ -55,7 +55,7 @@ def target
end end


it 'defaults to Sinatra::Application as target' do it 'defaults to Sinatra::Application as target' do
assert_equal Sinatra::Delegator.target, Sinatra::Application assert_equal Sinatra::Application, Sinatra::Delegator.target
end end


%w[get put post delete options patch].each do |verb| %w[get put post delete options patch].each do |verb|
Expand Down Expand Up @@ -91,19 +91,19 @@ def target
it "registers extensions with the delegation target" do it "registers extensions with the delegation target" do
app, mixin = mirror, Module.new app, mixin = mirror, Module.new
Sinatra.register mixin Sinatra.register mixin
assert_equal app.last_call, ["register", mixin.to_s ] assert_equal ["register", mixin.to_s], app.last_call
end end


it "registers helpers with the delegation target" do it "registers helpers with the delegation target" do
app, mixin = mirror, Module.new app, mixin = mirror, Module.new
Sinatra.helpers mixin Sinatra.helpers mixin
assert_equal app.last_call, ["helpers", mixin.to_s ] assert_equal ["helpers", mixin.to_s], app.last_call
end end


it "registers helpers with the delegation target" do it "registers helpers with the delegation target" do
app, mixin = mirror, Module.new app, mixin = mirror, Module.new
Sinatra.use mixin Sinatra.use mixin
assert_equal app.last_call, ["use", mixin.to_s ] assert_equal ["use", mixin.to_s], app.last_call
end end


it "should work with method_missing proxies for options" do it "should work with method_missing proxies for options" do
Expand Down

0 comments on commit 6c97d04

Please sign in to comment.