<commit_before>
buster.testCase('View#fire()', {
	setUp: helpers.createView,

	"Should run on callbacks registered on the view": function() {
		var spy = this.spy();

		this.view.on('testevent', spy);
		this.view.fire('testevent');
	  assert.called(spy);
	},

	"Events should bubble by default": function() {
		var spy = this.spy();
		var child = this.view.module('orange');

		this.view.on('childtestevent', spy);
		child.fire('childtestevent');
	  assert.called(spy);
	},

	"Calling event.stopPropagation() should stop bubbling": function() {
		var spy = this.spy();
		var child = this.view.module('orange');

		this.view.on('childtestevent', spy);
		child.on('childtestevent', function(){
			this.event.stopPropagation();
		});

		child.fire('childtestevent');
	  refute.called(spy);
	},

	"Should pass arguments to the callback": function() {
		var spy = this.spy();
		var arg1 = 'arg1';
		var arg2 = 'arg2';
		var arg3 = 'arg3';

		this.view.on('childtestevent', spy);
		this.view.fire('childtestevent', arg1, arg2, arg3);

	  assert.equals(spy.args[0][0], arg1);
	  assert.equals(spy.args[0][1], arg2);
	  assert.equals(spy.args[0][2], arg3);
	},

	tearDown: helpers.destroyView
});<commit_msg>Add test to prove support for simultanious events<commit_after>
buster.testCase('View#fire()', {
	setUp: helpers.createView,

	"Should run on callbacks registered on the view": function() {
		var spy = this.spy();

		this.view.on('testevent', spy);
		this.view.fire('testevent');
	  assert.called(spy);
	},

	"Events should bubble by default": function() {
		var spy = this.spy();
		var child = this.view.module('orange');

		this.view.on('childtestevent', spy);
		child.fire('childtestevent');

	  assert.called(spy);
	},

	"Calling event.stopPropagation() should stop bubbling": function() {
		var spy = this.spy();
		var child = this.view.module('orange');

		this.view.on('childtestevent', spy);
		child.on('childtestevent', function(){
			this.event.stopPropagation();
		});

		child.fire('childtestevent');
	  refute.called(spy);
	},

	"Should pass arguments to the callback": function() {
		var spy = this.spy();
		var arg1 = 'arg1';
		var arg2 = 'arg2';
		var arg3 = 'arg3';

		this.view.on('childtestevent', spy);
		this.view.fire('childtestevent', arg1, arg2, arg3);

	  assert.equals(spy.args[0][0], arg1);
	  assert.equals(spy.args[0][1], arg2);
	  assert.equals(spy.args[0][2], arg3);
	},

	"Should allow multiple events to be in progress on the same view": function() {
		var layout = this.view;
		var apple = layout.module('apple');
		var event;

		apple.on('testevent1', function() {
			event = this.event;
			assert.equals(this.event.target, apple, "testevent1 match failed");
		});

		apple.on('testevent1', function() {
			assert.equals(event, this.event, "testevent1 listener 2 match failed");
			apple.fire('testevent2');
		});

		apple.on('testevent2', function() {
			refute.equals(event, this.event, "testevent2 match failed");
			assert.equals(this.event.target, apple);
		});

		apple.fire('testevent1');
	},

	tearDown: helpers.destroyView
});
{'fraction_non_alphanumeric': 0.1778501628664495, 'fraction_numerical': 0.014657980456026058, 'mean_word_length': 4.267581475128645, 'pattern_counts': {'":': 9, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7356502', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1066, 'n_words': 233}