Skip to content

Commit a07119d

Browse files
committed
converting document names to strings is a WTF factory
1 parent 11ff68d commit a07119d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/decider/document.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def custom_transforms(transforms_module)
3131
attr_writer :domain_tokens
3232

3333
def initialize(name, raw_text)
34-
@name, @raw = name.to_s, raw_text
34+
@name, @raw = name, raw_text
3535
@domain_tokens, @additional_tokens, @finalized = [], [], false
3636
end
3737

spec/unit/clustering/base_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
@clusterer.push(:quick_brown, "the quick brown").push(:brown_fox, "brown fox jumped over")
4141
@clusterer.push(:lazy_dog, "lazy dog").push(:over_the, "over the quick brown dog")
4242
index_of = @clusterer.__send__(:token_indices)
43-
@clusterer.vectors["quick_brown"].to_a.length.should == 8
43+
@clusterer.vectors[:quick_brown].to_a.length.should == 8
4444
expected_vector = Array.new(8, 0)
4545
%w{over the quick brown dog}.each {|word| expected_vector[index_of[word]] = 1}
46-
@clusterer.vectors["over_the"].to_a.should == expected_vector
46+
@clusterer.vectors[:over_the].to_a.should == expected_vector
4747
end
4848

4949
end

spec/unit/document_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
Document.new(:simple_doc, "the original text").raw.should == "the original text"
1010
end
1111

12-
it "should have a name" do
13-
Document.new(:simple_doc, "the original text").name.should == "simple_doc"
14-
12+
it "should have a name and not convert it to a string" do
13+
Document.new(:simple_doc, "the original text").name.should == :simple_doc
1514
end
1615

1716
end

0 commit comments

Comments
 (0)