From d589e8b072559c5dc7f434f2d24ec98fbc86ec2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20Le=C3=9Fmann?= Date: Mon, 25 Jun 2012 00:52:18 +0200 Subject: [PATCH] Extended coverage of environmental requirements --- spec/environment.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/environment.coffee b/spec/environment.coffee index ad96800..37c6a5e 100644 --- a/spec/environment.coffee +++ b/spec/environment.coffee @@ -6,7 +6,17 @@ describe 'The JavaScript engine', -> expect(typeof location).toBe('object') expect(typeof location.hash).toBe('string') - it 'provides the onHashChange event', -> + it 'allows changing location.hash', -> + location.hash = '' + expect(location.hash).not.toEqual('#foo') + location.hash = 'foo' + expect(location.hash).toEqual('#foo') + + it 'ignores leading hash symbols when writing to location.hash', -> + location.hash = '#bar' + expect(location.hash).toEqual('#bar') + + it 'provides the "onHashChange" event', -> expect('onhashchange' of window).toBe(true)