mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
8256228e69
MINOR Updated jQuery.concrete references to point to the new "entwine" name git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102695 467b73ca-7a2a-4603-9d3b-597d59a354a9
62 lines
1.4 KiB
JavaScript
62 lines
1.4 KiB
JavaScript
|
|
JSpec.include({
|
|
name: 'Helpers',
|
|
utilities : {
|
|
mock_it : function(body) {
|
|
var spec = new JSpec.Spec('mock', body)
|
|
var prev = JSpec.currentSpec
|
|
JSpec.runSpec(spec)
|
|
JSpec.currentSpec = prev
|
|
return spec
|
|
}
|
|
},
|
|
|
|
matchers : {
|
|
have_failure_message : function(spec, expected) {
|
|
return JSpec.any(spec.assertions, function(assertion){
|
|
if (assertion.passed) return
|
|
switch (expected.constructor) {
|
|
case String: return assertion.message == expected
|
|
case RegExp: return expected.test(assertion.message)
|
|
default : return false
|
|
}
|
|
})
|
|
}
|
|
}
|
|
})
|
|
|
|
JSpec.include({
|
|
name: 'ExampleModule',
|
|
utilities : {
|
|
doFoo : function(){ return 'foo' },
|
|
doBar : function(){ return 'bar' }
|
|
},
|
|
randomHook : function(a, b) {
|
|
return [a, b]
|
|
},
|
|
beforeSpec : function() { addedBeforeSpec = true; this.utilities.doFoo() },
|
|
afterSpec : function() { addedAfterSpec = true },
|
|
beforeSuite : function() { addedBeforeSuite = true },
|
|
afterSuite : function() { addedAfterSuite = true },
|
|
matchers : {
|
|
be_foo_bar : function() {
|
|
return true
|
|
}
|
|
},
|
|
DSLs : {
|
|
snake : {
|
|
some_snake_case_stuff : function(){
|
|
return true
|
|
}
|
|
},
|
|
camel : {
|
|
someCamelCaseStuff : function() {
|
|
return true
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
JSpec.include({
|
|
name : 'EmptyModule'
|
|
}) |