Sha256: eaa88020b22c1949aa6b5fe9f0bae3967fb8a9e2ebbd9a62ea3cb32f8bc9a038

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

require 'assert'
require 'dassets/engine'

class Dassets::Engine

  class UnitTests < Assert::Context
    desc "Dassets::Engine"
    setup do
      @engine = Dassets::Engine.new
    end
    subject{ @engine }

    should have_reader :opts
    should have_imeths :ext, :compile

    should "default the opts if none given" do
      exp_opts = {}
      assert_equal exp_opts, subject.opts
    end

    should "raise NotImplementedError on `ext` and `compile`" do
      assert_raises NotImplementedError do
        subject.ext('foo')
      end

      assert_raises NotImplementedError do
        subject.compile('some content')
      end
    end

  end

  class NullEngineTests < Assert::Context
    desc "Dassets::NullEngine"
    setup do
      @engine = Dassets::NullEngine.new('some' => 'opts')
    end
    subject{ @engine }

    should "be a Engine" do
      assert_kind_of Dassets::Engine, subject
    end

    should "know its opts" do
      exp_opts = {'some' => 'opts'}
      assert_equal exp_opts, subject.opts
    end

    should "return the given extension on `ext`" do
      assert_equal 'foo', subject.ext('foo')
    end

    should "return the given input on `compile" do
      assert_equal 'some content', subject.compile('some content')
    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dassets-0.14.5 test/unit/engine_tests.rb
dassets-0.14.4 test/unit/engine_tests.rb
dassets-0.14.3 test/unit/engine_tests.rb
dassets-0.14.2 test/unit/engine_tests.rb
dassets-0.14.1 test/unit/engine_tests.rb
dassets-0.14.0 test/unit/engine_tests.rb
dassets-0.13.2 test/unit/engine_tests.rb
dassets-0.13.1 test/unit/engine_tests.rb
dassets-0.13.0 test/unit/engine_tests.rb
dassets-0.12.0 test/unit/engine_tests.rb
dassets-0.11.0 test/unit/engine_tests.rb
dassets-0.10.1 test/unit/engine_tests.rb
dassets-0.10.0 test/unit/engine_tests.rb
dassets-0.9.0 test/unit/engine_tests.rb