« index

Coverage for /Users/kris/q-io/spec/fs/mock/remove-tree-spec.js : 100%

38 lines | 38 run | 0 missing | 0 partial | 5 blocks | 5 blocks run | 0 blocks missing

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

  "use strict";
  
  require("../../lib/jasmine-promise");
  var Q = require("q");
  var FS = require("../../../fs");
  var Mock = require("../../../fs-mock");
  var normalize = FS.normal;
  
  describe("removeTree", function () {
      it("should remove a tree", function () {
  
          var mock = Mock({
              "a/b": {
                  "c": {
                      "d": 66,
                      "e": 99
                  }
              }
          });
  
          return Q.fcall(function () {
              return mock.removeTree("a/b/c");
          })
  
          .then(function () {
              return mock.listTree();
          })
          .then(function (list) {
              expect(list).toEqual([
                  ".",
                  "a",
                  normalize("a/b")
              ]);
          })
  
      });
  
  });
« index | cover.io