Sha256: a1da6e93db14cbd9fb8e485ee5f68916ee51e55a960f707597b98d286631bd9a

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

if defined?(::Rails)
require 'tempfile'
require 'generators/rack/dev-mark/install_generator'
describe Rack::DevMark::InstallGenerator do
  include_context 'forked spec'

  context "config/application.rb" do
    let(:application_rb) { Tempfile.new('config_application.rb') }
    before do
      application_rb.write <<-EOS
module MyApp
  class Application < Rails::Application
    # ...
  end
end
      EOS
      application_rb.rewind
      allow_any_instance_of(Rack::DevMark::InstallGenerator).to receive(:target_path).and_return(application_rb.path)
    end
    after do
      application_rb.close
      application_rb.unlink
    end

    it 'inserts rack-dev-mark settings' do
      Rails::Generators.invoke("rack:dev-mark:install")
      application_rb.rewind
      expect(application_rb.read).to eq <<-EOS
module MyApp
  class Application < Rails::Application
    # Enable rack-dev-mark
    config.rack_dev_mark.enable = !Rails.env.production?
    # Customize themes if you want to do so
    # config.rack_dev_mark.theme = [:title, :github_fork_ribbon]

    # ...
  end
end
      EOS
    end
  end
end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rack-dev-mark-0.6.3 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.6.2 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.6.0 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.5.1 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.5.0 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.4.6 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.4.5 spec/generators/rack/dev-mark/install_generator_spec.rb
rack-dev-mark-0.4.4 spec/generators/rack/dev-mark/install_generator_spec.rb