Sha256: 406c3a19e40cc81928f4c76621a688755cd6ee07a1821df6c8302023b47c95e3

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

RSpec.describe Eman::Recommender do

  before(:each) do
    @generator = Eman::Generator.new('Service')
    @generator.resource = 'Train Conductor'
    @generator.verb = 'Whistling'

    @formatter = Eman::Recommender.new(@generator)
  end

  describe '#inputs' do
    it 'returns the generators inputs' do
      expect(@formatter.inputs).to eq ['Train', 'Conductor', 'Whistling']
    end
  end

  describe '#words_hash' do
    it 'returns hash of words as keys and empty arrays as values' do
      expect(@formatter.words_hash).to eq({ 'Train' => [], 'Conductor' => [], 'Whistling' => [] })
    end
  end

  describe '#recommend_name' do
    it 'recommends a name' do
      set_up_custom_dictionary

      generator = Eman::Generator.new('Controller')
      generator.resource = 'deep'

      recommender = Eman::Recommender.new(generator)

      puts recommender.words_hash

      recommended_name = recommender.recommend_name

      puts recommender.words_hash
      expect(recommended_name.resource).to eq 'house'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eman-0.0.3 spec/recommender_spec.rb