Logo: Relish

  1. Sign in

Project: Pannier v0.5.0

Package behaviors

In order to avoid repetitive package setup
As a developer
I want to define behaviors and mix them into packages

Scenarios
Defining a behavior and using it in multiple packages
Given
the file "input/foo.js" contains
/* comment */
And
the file ".assets.rb" contains
input  'input'
output 'output'

behavior :bar do
  modify do |content, basename|
    [content.reverse, basename]
  end
end

package :baz do
  behave :bar
  assets 'foo.js'
end
And
the app is loaded in a production environment
And
the app has been processed
Then
the file "output/foo.js" should contain
/* tnemmoc */

Last published almost 4 years ago by joecorcoran.