Skip to content

Instantly share code, notes, and snippets.

@leepfrog
Last active March 25, 2021 16:17
Show Gist options
  • Select an option

  • Save leepfrog/5073459 to your computer and use it in GitHub Desktop.

Select an option

Save leepfrog/5073459 to your computer and use it in GitHub Desktop.
require '../../test_helper.coffee'
describe 'ArrayPipeline', ->
describe '#_setupPlugin()', ->
it 'should instantiate a plugin from a constant', ->
pipeline = Em.ArrayProxy.createWithMixins(Em.ArrayPipelineMixin,{})
pipeline.get('_processors.length').should.equal(0)
pipeline._setupPlugin(Em.PipePlugin)
pipeline.get('_processors.length').should.equal(1)
pipeline.get('_processors.firstObject').should.be.instanceof(Em.PipePlugin)
it 'should instantiate a plugin from a string', ->
pipeline = Em.ArrayProxy.createWithMixins(Em.ArrayPipelineMixin,{})
pipeline.get('_processors.length').should.equal(0)
pipeline._setupPlugin('Em.PipePlugin')
pipeline.get('_processors.length').should.equal(1)
pipeline.get('_processors.firstObject').should.be.instanceof(Em.PipePlugin)
Ember.ArrayPipelineMixin = Ember.Mixin.create
# This is our result output from the ArrayPipeline
results: []
# This is our array of plugins to use
plugins: []
# This is our array of instantiated plugins to actually use for processing
# @private
_processors: []
@leepfrog
Copy link
Author

leepfrog commented Mar 2, 2013

the problem is, line #9 works correctly... line #16 doesn't work correctly (there's an object in the array)...

@leepfrog
Copy link
Author

leepfrog commented Mar 2, 2013

Nevermind.. brainfart.. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment