diff --git a/src/backbone.radio.js b/src/backbone.radio.js index f448333..3106775 100644 --- a/src/backbone.radio.js +++ b/src/backbone.radio.js @@ -1,21 +1,10 @@ import _ from 'underscore'; import Backbone from 'backbone'; -var previousRadio = Backbone.Radio; - -var Radio = Backbone.Radio = {}; +var Radio = {}; Radio.VERSION = '<%= version %>'; -// This allows you to run multiple instances of Radio on the same -// webapp. After loading the new version, call `noConflict()` to -// get a reference to it. At the same time the old version will be -// returned to Backbone.Radio. -Radio.noConflict = function() { - Backbone.Radio = previousRadio; - return this; -}; - // Whether or not we're in DEBUG mode or not. DEBUG mode helps you // get around the issues of lack of warnings when events are mis-typed. Radio.DEBUG = false; diff --git a/test/setup/setup.js b/test/setup/setup.js index ea3fb85..c4a521b 100644 --- a/test/setup/setup.js +++ b/test/setup/setup.js @@ -3,7 +3,7 @@ module.exports = function(root) { global.Backbone = require('backbone'); global.expect = global.chai.expect; global.slice = Array.prototype.slice; - global.Radio = require('../../src/backbone.radio'); + global.Backbone.Radio = global.Radio = require('../../src/backbone.radio').default; beforeEach(function() { this.sinon = global.sinon.sandbox.create(); diff --git a/test/unit/form.js b/test/unit/form.js index 51ae017..f7da8f2 100644 --- a/test/unit/form.js +++ b/test/unit/form.js @@ -7,10 +7,6 @@ describe('When Radio is attached to your application', function() { expect(Backbone.Radio.VERSION).to.exist; }); - it('should have a noConflict method', function() { - expect(Backbone.Radio.noConflict).to.exist; - }); - it('should have the channel method', function() { expect(Backbone.Radio.channel).to.exist; }); diff --git a/test/unit/no-conflict.js b/test/unit/no-conflict.js deleted file mode 100644 index 4254723..0000000 --- a/test/unit/no-conflict.js +++ /dev/null @@ -1,19 +0,0 @@ -describe('No conflict:', function() { - beforeEach(function() { - this.noConflictSpy = spy(Backbone.Radio, 'noConflict'); - this.Radio = Backbone.Radio; - Backbone.Radio.noConflict(); - }); - - afterEach(function() { - Backbone.Radio = this.Radio; - }); - - it('should have always returned the new instance of Backbone.Radio', function() { - expect(this.noConflictSpy).to.have.always.returned(this.Radio); - }); - - it('should set Backbone.Radio to be what it was before: undefined', function() { - expect(Backbone.Radio).to.be.undefined; - }); -});