Sha256: cfd5afd6b537a83b681503edfef7464fb49d9c8bde927a0983926068356f0f53

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

require 'generators/network_executive/uninstall_generator'

describe NetworkExecutive::UninstallGenerator do
  before do
    described_class.any_instance.stub(:say)
    described_class.any_instance.stub(:remove_file)
    described_class.any_instance.stub(:gsub_file)
  end

  describe '#uninstall' do
    before do
      FakeFS::FileSystem.clone File.join( Rails.root, 'config' )
    end

    subject { described_class.new.uninstall }

    it 'should remove the initializers' do
      remove_args = [
        'config/initializers/network_executive.rb',
        'config/initializers/network_executive.rb.example'
      ]

      described_class.any_instance.should_receive(:remove_file).with( remove_args[0] ).with( remove_args[1] )

      subject
    end

    it 'should unmount the engine' do
      gsub_args = [
        'config/routes.rb',
        /mount NetworkExecutive::Engine => \'\/.+\', as:\S*\'network_executive\'/, ''
      ]

      described_class.any_instance.should_receive(:gsub_file).with( *gsub_args )

      subject
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
network_executive-0.0.8 spec/generators/uninstall_generator_spec.rb
network_executive-0.0.7 spec/generators/uninstall_generator_spec.rb
network_executive-0.0.4 spec/generators/uninstall_generator_spec.rb
network_executive-0.0.3 spec/generators/uninstall_generator_spec.rb
network_executive-0.0.2 spec/generators/uninstall_generator_spec.rb