Sha256: ae57f0f83dca1182218f863e18d840c0b99955663be697e8b04efd08ace05fa3

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

require 'spec_helper'
require 'rails/generators/test_case'
require 'generators/less_rails_bootstrap/custom_bootstrap/custom_bootstrap_generator'

class CustomBootstrapGeneratorTest < Rails::Generators::TestCase
  tests LessRailsBootstrap::Generators::CustomBootstrapGenerator

  destination Rails.root.join('tmp/generators')
  setup :prepare_destination

  def setup
    run_generator
  end

  test "content of custom_bootstrap.less was changed" do
    md5 = Digest::MD5.file(destination_root.join("app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less")).hexdigest
    assert_equal '337291aa6cd4515c56d686f16c641930', md5,
      'Looks like content of custom_bootstrap.less was changed. Please, investigate the reason of this and fix test if these changes are appropriate.'
  end

  test "custom_bootstrap.less is generated" do
    assert_file(destination_root.join("app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less"), /@import/)
  end

  test "variables.less is generated" do
    assert_file("app/assets/stylesheets/custom_bootstrap/variables.less",
      "// Use this file to override Twitter Bootstrap variables or define own variables.\n")
  end

  test "mixins.less is generated" do
    assert_file("app/assets/stylesheets/custom_bootstrap/mixins.less",
      "// Use this file to override Twitter Bootstrap mixins or define own mixins.\n")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
less-rails-bootstrap-3.3.4.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.3.2.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.3.1.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.3.0.1 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.3.0.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.2.0 test/cases/generators/custom_bootstrap_generator_test.rb