Sha256: 8ed02913c1e3830d1826d7716faa83b3f9f5d29a6f090cc3e0a957fcfbe5e059

Contents?: true

Size: 839 Bytes

Versions: 24

Compression:

Stored size: 839 Bytes

Contents

var tape = require('tape')
  , caseless = require('./')
  ;

tape('set get has', function (t) {
  var headers = {}
    , c = caseless(headers)
    ;
  t.plan(14)
  c.set('a-Header', 'asdf')
  t.equal(c.get('a-header'), 'asdf')
  t.equal(c.has('a-header'), 'a-Header')
  t.ok(!c.has('nothing'))
  // old bug where we used the wrong regex
  t.ok(!c.has('a-hea'))
  c.set('a-header', 'fdsa')
  t.equal(c.get('a-header'), 'fdsa')
  t.equal(c.get('a-Header'), 'fdsa')
  c.set('a-HEADER', 'more', false)
  t.equal(c.get('a-header'), 'fdsa,more')

  t.deepEqual(headers, {'a-Header': 'fdsa,more'})
  c.swap('a-HEADER')
  t.deepEqual(headers, {'a-HEADER': 'fdsa,more'})

  c.set('deleteme', 'foobar')
  t.ok(c.has('deleteme'))
  t.ok(c.del('deleteme'))
  t.notOk(c.has('deleteme'))
  t.notOk(c.has('idonotexist'))
  t.ok(c.del('idonotexist'))

})

Version data entries

24 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/request/node_modules/caseless/test.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/request/node_modules/caseless/test.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/request/node_modules/caseless/test.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/request/node_modules/caseless/test.js
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/node_modules/request/node_modules/caseless/test.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/request/node_modules/caseless/test.js