spec/lib/generators/similarity/phonetic_spec.rb in picky-4.10.0 vs spec/lib/generators/similarity/phonetic_spec.rb in picky-4.11.0

- old
+ new

@@ -1,22 +1,29 @@ # encoding: utf-8 # require 'spec_helper' +require 'text' + describe Picky::Generators::Similarity::Phonetic do - it 'raises if you try to use Phonetic directly' do - expect { - described_class.new - }.to raise_error("In Picky 2.0+, the Similarity::Phonetic has been renamed to Similarity::DoubleMetaphone. Please use that one. Thanks!") - end - it "raises when you don't have the text gem" do instance = Class.new(described_class).allocate instance.should_receive(:require).any_number_of_times.and_raise LoadError + + Picky.logger.should_receive(:warn).once.with <<-EXPECTED +Warning: text gem missing! +To use a phonetic Similarity, you need to: + 1. Add the following line to Gemfile: + gem 'text' + or + require 'text' + for example at the top of your app.rb file. + 2. Then, run: + bundle update +EXPECTED - instance.should_receive(:warn).once.with "text gem missing!\nTo use a phonetic Similarity, you need to:\n 1. Add the following line to Gemfile:\n gem 'text'\n 2. Then, run:\n bundle update\n" instance.should_receive(:exit).once.with 1 instance.send :initialize end \ No newline at end of file