Sha256: 3a030dc4b3a185cc2e92f7ebf5a4d95e018b6fccda24071a536976503b8c4ac2

Contents?: true

Size: 1.54 KB

Versions: 23

Compression:

Stored size: 1.54 KB

Contents

describe("ResultsNode", function() {
  it("wraps a result", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);

    expect(node.result).toBe(fakeResult);
    expect(node.type).toEqual("suite");
  });

  it("can add children with a type", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.children.length).toEqual(1);
    expect(node.children[0].result).toEqual(fakeChildResult);
    expect(node.children[0].type).toEqual("spec");
  });

  it("has a pointer back to its parent ResultNode", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.children[0].parent).toBe(node);
  });

  it("can provide the most recent child", function() {
    var fakeResult = {
        id: 123,
        message: "foo"
      },
      fakeChildResult = {
        id: 456,
        message: "bar"
      },
      node = new jasmineUnderTest.ResultsNode(fakeResult, "suite", null);

    node.addChild(fakeChildResult, "spec");

    expect(node.last()).toBe(node.children[node.children.length - 1]);
  });
});

Version data entries

23 entries across 20 versions & 2 rubygems

Version Path
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/jasmine-core-2.8.0/lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.99.1 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-3.0.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.99.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.9.1 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.9.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.7 vendor/bundle/gems/jasmine-core-2.8.0/lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.6 vendor/bundle/gems/jasmine-core-2.8.0/lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.8.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.7.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/jasmine-core-2.5.2/lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.5 vendor/bundle/gems/jasmine-core-2.5.2/lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.5 vendor/bundle/gems/jasmine-core-2.6.3/lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.5 vendor/bundle/gems/jasmine-core-2.6.4/lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.6.4 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.6.3 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.6.2 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.6.1 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
jasmine-core-2.6.0 ./lib/jasmine-core/spec/html/ResultsNodeSpec.js
tdiary-5.0.4 vendor/bundle/gems/jasmine-core-2.5.2/lib/jasmine-core/spec/html/ResultsNodeSpec.js