Commit da110a36 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix failing tests for Categories.

Didn't notice the specs failing because the files of installed
jsduck got loaded instead of the jsduck files in repository.
parent 11ea2d2e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
require "jsduck/categories"
require "jsduck/categories/factory"

describe JsDuck::Categories do
describe JsDuck::Categories::Factory do

  # Small helper to check the sums
  def sum(arr)
@@ -9,7 +9,7 @@ describe JsDuck::Categories do

  # Replace the sum method with the one that simply sums the numbers,
  # so we can use simpler test-data.
  class JsDuck::Categories
  class JsDuck::Categories::Factory
    def sum(arr)
      arr.reduce(0) {|sum,x| sum + x }
    end
@@ -17,7 +17,7 @@ describe JsDuck::Categories do

  describe "#split" do
    before do
      @categories = JsDuck::Categories.new([], {}, {})
      @categories = JsDuck::Categories::Factory.new([], {}, {})
    end

    it "split(1 item by 1)" do
+3 −3
Original line number Diff line number Diff line
require "jsduck/file_categories"
require "jsduck/categories/file"

describe JsDuck::FileCategories do
describe JsDuck::Categories::File do

  describe "#expand" do
    before do
@@ -10,7 +10,7 @@ describe JsDuck::FileCategories do
        {:name => "Foo.Blah"},
        {:name => "Bar.Ahhh"},
      ]
      @categories = JsDuck::FileCategories.new("", classes)
      @categories = JsDuck::Categories::File.new("", classes)
    end

    it "expands class without * in name into the same class" do