spec/burgundy_spec.rb in burgundy-0.0.3 vs spec/burgundy_spec.rb in burgundy-0.0.4
- old
+ new
@@ -25,10 +25,15 @@
it 'wraps items in collection' do
collection = Burgundy::Collection.new([1,2,3], wrapper)
expect(collection.first).to eql(1)
end
+ it 'delegates collection calls' do
+ collection = Burgundy::Collection.new([1,2,3], wrapper)
+ expect(collection.size).to eql(3)
+ end
+
it 'includes Enumerable' do
expect(Burgundy::Collection).to include(Enumerable)
end
it 'implements #empty?' do
@@ -40,27 +45,27 @@
end
it 'responds to the routes method' do
item = wrapper.new('hello')
- expect(item.respond_to?(:routes, true)).to be
- expect(item.respond_to?(:r, true)).to be
+ expect(item).to respond_to(:routes)
+ expect(item).to respond_to(:r)
end
it 'responds to the helpers method' do
item = wrapper.new('hello')
- expect(item.respond_to?(:helpers, true)).to be
- expect(item.respond_to?(:h, true)).to be
+ expect(item).to respond_to(:helpers)
+ expect(item).to respond_to(:h)
end
it 'responds to the I18n methods' do
item = wrapper.new('hello')
- expect(item.respond_to?(:translate, true)).to be
- expect(item.respond_to?(:t, true)).to be
- expect(item.respond_to?(:localize, true)).to be
- expect(item.respond_to?(:l, true)).to be
+ expect(item).to respond_to(:translate)
+ expect(item).to respond_to(:t)
+ expect(item).to respond_to(:localize)
+ expect(item).to respond_to(:l)
end
it 'returns route using action mailer options' do
wrapper = Class.new(Burgundy::Item) do
def profile_url; routes.profile_url(username) end