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-5.0.4 spec/bobot/install_generator_spec.rb
bobot-5.0.3 spec/bobot/install_generator_spec.rb
bobot-5.0.2 spec/bobot/install_generator_spec.rb
bobot-5.0.1 spec/bobot/install_generator_spec.rb
bobot-5.0.0 spec/bobot/install_generator_spec.rb
bobot-4.15.0 spec/bobot/install_generator_spec.rb
bobot-4.14.0 spec/bobot/install_generator_spec.rb
bobot-4.13.1 spec/bobot/install_generator_spec.rb
bobot-4.13.0 spec/bobot/install_generator_spec.rb
bobot-4.11.0 spec/bobot/install_generator_spec.rb
bobot-4.10.0 spec/bobot/install_generator_spec.rb
bobot-4.9.0 spec/bobot/install_generator_spec.rb
bobot-4.8.0 spec/bobot/install_generator_spec.rb
bobot-4.7.0 spec/bobot/install_generator_spec.rb
bobot-4.6.0 spec/bobot/install_generator_spec.rb
bobot-4.5.0 spec/bobot/install_generator_spec.rb
bobot-4.4.1 spec/bobot/install_generator_spec.rb
bobot-4.4.0 spec/bobot/install_generator_spec.rb
bobot-4.3.1 spec/bobot/install_generator_spec.rb
bobot-4.3.0 spec/bobot/install_generator_spec.rb