Skip to content
Myr

spec.plugins.js

This file

Path

spec/spec.plugins.js

39 lines · 889 bytes · JavaScript

Last changed by

One instance of a Plugin per requestvisionmediabefore adoption53eda82

History of this file

Take it

Started Pluginvisionmediabefore adoption8158a3d

line 1why, one step back
1

CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c

line 2why, one step back
2CSSColors = Plugin.extend({

Started Pluginvisionmediabefore adoption8158a3d

line 3why, one step back
3 on: {

e -> eventvisionmediabefore adoption60b4571

lines 4–6why, one step back
4 response: function(event) {
5 if (event.response.headers['content-type'] == mime('css'))6 event.response.body = event.response.body.replace('black', '#000')

Started Pluginvisionmediabefore adoption8158a3d

lines 7–14why, one step back
7 }
8 }9})1011describe 'Express'12 describe 'use()'13 before_each14 reset()

CSSVariables -> CSSColors examplevisionmediabefore adoption5c7341c

line 15why, one step back
15 use(CSSColors)

Started Pluginvisionmediabefore adoption8158a3d

lines 16–17why, one step back
16 end
17

Added Event data arg specvisionmediabefore adoption3d4d62a

lines 18–26why, one step back
18 describe 'Event'
19 describe '#init()'20 it 'should accept arbitrary data'21 var event = new Event('foo', { bar: 'baz' })22 event.bar.should.eql 'baz'23 end24 end25 end26

Started Pluginvisionmediabefore adoption8158a3d

line 27why, one step back
27 describe 'events'

Added Event data arg specvisionmediabefore adoption3d4d62a

line 28why, one step back
28 describe 'response'

Started Pluginvisionmediabefore adoption8158a3d

lines 29–39why, one step back
29 it 'should be triggered before headers and body are sent'
30 get('/style.css', function(){31 contentType('css')32 return 'body { color: black; }'33 })34 get('/style.css').body.should.eql 'body { color: #000; }'35 end36 end37 end38 end39end