Sha256: ef93b217193a8b8e57de1fa3f81ace33045e9c91606363c2cbe65b4bd005b648
Contents?: true
Size: 764 Bytes
Versions: 14
Compression:
Stored size: 764 Bytes
Contents
require 'spec_helper' require 'cuba_api/config' require 'cuba_api/write_aspect' module Plugin def one( obj, opts ) obj + "-one" end def two( obj, opts ) obj + "-two" end def three( obj, opts ) obj + "-three" end end describe CubaApi::WriteAspect do before do Cuba.reset! Cuba.plugin CubaApi::Config Cuba[ :aspects ] = [] Cuba.plugin CubaApi::WriteAspect Cuba.plugin Plugin Cuba.append_aspect :one Cuba.prepend_aspect :two Cuba.append_aspect :three Cuba.define do on true do write 'start' end end end after { Cuba.config.clear } it 'should execute aspects in the right order' do _, _, resp = Cuba.call({}) resp.join.must.eq "start-two-one-three" end end
Version data entries
14 entries across 12 versions & 1 rubygems