summaryrefslogtreecommitdiff
path: root/axios/test/specs/cancel/Cancel.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'axios/test/specs/cancel/Cancel.spec.js')
-rw-r--r--axios/test/specs/cancel/Cancel.spec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/axios/test/specs/cancel/Cancel.spec.js b/axios/test/specs/cancel/Cancel.spec.js
new file mode 100644
index 0000000..0e0de80
--- /dev/null
+++ b/axios/test/specs/cancel/Cancel.spec.js
@@ -0,0 +1,15 @@
+var Cancel = require('../../../lib/cancel/Cancel');
+
+describe('Cancel', function() {
+ describe('toString', function() {
+ it('returns correct result when message is not specified', function() {
+ var cancel = new Cancel();
+ expect(cancel.toString()).toBe('Cancel');
+ });
+
+ it('returns correct result when message is specified', function() {
+ var cancel = new Cancel('Operation has been canceled.');
+ expect(cancel.toString()).toBe('Cancel: Operation has been canceled.');
+ });
+ });
+});