Sha256: 98f05d81f1c0c510c7c50fd438d1289fe4a2626556788de32084ba8a66929ab7

Contents?: true

Size: 1.34 KB

Versions: 5

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 '4e87e1db9ef280b02cee47634f975ca1', 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

5 entries across 5 versions & 1 rubygems

Version Path
less-rails-bootstrap-3.1.1.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.1.0.0 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.0.6 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.0.5 test/cases/generators/custom_bootstrap_generator_test.rb
less-rails-bootstrap-3.0.4 test/cases/generators/custom_bootstrap_generator_test.rb