Skip to content

Commit

Permalink
Obsolute factory method. FuzzyStringMatch#create.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoka committed Nov 23, 2013
1 parent ccc5ce3 commit e3fe323
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 0 additions & 4 deletions lib/fuzzystringmatch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,5 @@ def self.create( type = :pure ) # factory method
end
end
end
def create( type = :pure ) # this is obsolute
STDERR.puts "fuzzy-string-match Warning: FuzzyStringMatch.new.create() is obsolute, please use FuzzyStringMatch.create() ..."
FuzzyStringMatch::JaroWinkler.create( type )
end
end
end
8 changes: 2 additions & 6 deletions test/basic_native_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@
end
end

describe FuzzyStringMatch, "when older factory method was called, (Pure) are" do
before do
@jarow = FuzzyStringMatch::JaroWinkler.new.create
end
describe FuzzyStringMatch, "when older factory method was called, (Native) are" do
it "should" do
@jarow.getDistance( "henka", "henkan" ).should be_within(0.0001).of(0.9722)
@jarow.pure?( ).should be_true
lambda { FuzzyStringMatch::JaroWinkler.new.create( :native ) }.should raise_error(NoMethodError)
end
end
9 changes: 3 additions & 6 deletions test/basic_pure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@
end
end

describe FuzzyStringMatch, "when older factory method was called, (Pure) are" do
before do
@jarow = FuzzyStringMatch::JaroWinkler.new.create
end
describe FuzzyStringMatch, "when older factory method was called, (Native) are" do
it "should" do
@jarow.getDistance( "henka", "henkan" ).should be_within(0.0001).of(0.9722)
@jarow.pure?( ).should be_true
lambda { FuzzyStringMatch::JaroWinkler.new.create( :pure ) }.should raise_error(NoMethodError)
end
end

0 comments on commit e3fe323

Please sign in to comment.