Sha256: 3fb5e122d0f530bdf793225cfe3fc23913852f975c415697eb721c733e3234d7

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 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 '1f5b67b27608c7c5db14ad0b9c6cacbb', md5,
      'Looks like content of custom_bootstrap.less was changed. Please, investigate the reason of this and fix test if these changes is 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

1 entries across 1 versions & 1 rubygems

Version Path
less-rails-bootstrap-3.0.3 test/cases/generators/custom_bootstrap_generator_test.rb