test/base/test_rule_context.rb in nanoc-3.7.4 vs test/base/test_rule_context.rb in nanoc-3.7.5
- old
+ new
@@ -1,9 +1,8 @@
# encoding: utf-8
class Nanoc::RuleContextTest < Nanoc::TestCase
-
def test_objects
# Mock everything
config = mock
items = mock
layouts = mock
@@ -16,11 +15,11 @@
rep = mock
rep.stubs(:item).returns(item)
compiler = Nanoc::Compiler.new(site)
# Create context
- @rule_context = Nanoc::RuleContext.new(:rep => rep, :compiler => compiler)
+ @rule_context = Nanoc::RuleContext.new(rep: rep, compiler: compiler)
# Check
assert_equal rep, @rule_context.rep
assert_equal item, @rule_context.item
assert_equal site, @rule_context.site
@@ -42,22 +41,21 @@
item.stubs(:site).returns(site)
# Mock rep
rep = mock
rep.stubs(:item).returns(item)
- rep.expects(:filter).with(:foo, { :bar => 'baz' })
+ rep.expects(:filter).with(:foo, { bar: 'baz' })
rep.expects(:layout).with('foo')
rep.expects(:snapshot).with('awesome')
# Mock compiler
compiler = Nanoc::Compiler.new(site)
# Create context
- @rule_context = Nanoc::RuleContext.new(:rep => rep, :compiler => compiler)
+ @rule_context = Nanoc::RuleContext.new(rep: rep, compiler: compiler)
# Check
- rep.filter :foo, :bar => 'baz'
+ rep.filter :foo, bar: 'baz'
rep.layout 'foo'
rep.snapshot 'awesome'
end
-
end