Sha256: 608addd0a4535a4b32a0b19d0414737ad9141ac81f16ffb53a55839440dd1d81

Contents?: true

Size: 1.08 KB

Versions: 47

Compression:

Stored size: 1.08 KB

Contents

require 'rails_helper'
require 'generators/bobot/install_generator'

RSpec.describe Bobot::InstallGenerator, type: :generator do
  destination File.expand_path('../../dummy/tmp/generator', __FILE__)
  arguments ['bot']

  before do
    prepare_destination
  end

  it 'mounts Bobot as Engine and generates Bobot Initializer' do
    expect_any_instance_of(generator_class).to receive(:route).
      with('mount Bobot::Engine => \'/bot\', as: \'bot\'')
    silence_stream(STDOUT) do
      generator.invoke('install')
    end
    expect(destination_root).to have_structure {
      directory 'config' do
        directory 'initializers' do
          file 'bobot.rb' do
            contains 'Bobot.configure'
          end
        end
        directory 'locales' do
          file 'bobot.en.yml' do
            contains 'en:'
          end
          file 'bobot.fr.yml' do
            contains 'fr:'
          end
        end
      end
      directory 'app' do
        directory 'bobot' do
          file 'workflow.rb' do
            contains 'Bobot::Commander'
          end
        end
      end
    }
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
bobot-2.6.1 spec/bobot/install_generator_spec.rb
bobot-2.6.0 spec/bobot/install_generator_spec.rb
bobot-2.5.0 spec/bobot/install_generator_spec.rb
bobot-2.3.0 spec/bobot/install_generator_spec.rb
bobot-2.1.0 spec/bobot/install_generator_spec.rb
bobot-1.0.53 spec/bobot/install_generator_spec.rb
bobot-1.0.52 spec/bobot/install_generator_spec.rb