Move spec files back out of spec/javascripts
- Jasmine gem allows us to specify a path to jasmine.yml via ENV [finish #58126010]
This commit is contained in:
23
spec/helpers/BrowserFlags.js
Normal file
23
spec/helpers/BrowserFlags.js
Normal file
@@ -0,0 +1,23 @@
|
||||
(function(env) {
|
||||
function browserVersion(matchFn) {
|
||||
var userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||
if (!userAgent) { return void 0; }
|
||||
|
||||
var match = matchFn(userAgent);
|
||||
|
||||
return match ? parseFloat(match[1]) : void 0;
|
||||
}
|
||||
|
||||
env.ieVersion = browserVersion(function(userAgent) {
|
||||
return /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
|
||||
});
|
||||
|
||||
env.safariVersion = browserVersion(function(userAgent) {
|
||||
return /Safari/.exec(userAgent) && /Version\/([0-9]{0,})/.exec(userAgent);
|
||||
});
|
||||
|
||||
env.firefoxVersion = browserVersion(function(userAgent) {
|
||||
return /Firefox\/([0-9]{0,})/.exec(userAgent);
|
||||
});
|
||||
|
||||
})(jasmine.getEnv());
|
||||
Reference in New Issue
Block a user