test/unit/dassets_tests.rb in dassets-0.15.0 vs test/unit/dassets_tests.rb in dassets-0.15.1

- old
+ new

@@ -1,26 +1,28 @@ +# frozen_string_literal: true + require "assert" require "dassets" require "fileutils" require "dassets/asset_file" module Dassets class UnitTests < Assert::Context desc "Dassets" - subject { Dassets } + subject{ Dassets } should have_imeths :config, :configure, :init, :reset should have_imeths :asset_file, :[], :source_files, :combinations should "return a `Config` instance with the `config` method" do assert_that(subject.config).is_kind_of(Dassets::Config) end should "know how to reset itself" do config_reset_called = false - Assert.stub(subject.config, :reset) { config_reset_called = true } + Assert.stub(subject.config, :reset){ config_reset_called = true } file1 = subject["nested/file3.txt"] subject.reset @@ -43,14 +45,14 @@ assert_that(file2).is(file1) end should "complain if digest path is not found using the index operator" do - assert_that(-> { + assert_that(->{ subject.asset_file("path/not/found.txt") }).does_not_raise - assert_that { subject["path/not/found.txt"] }.raises(AssetFileError) + assert_that{ subject["path/not/found.txt"] }.raises(AssetFileError) end should "know its list of configured source files" do exp = Dassets::SourceFiles.new(subject.config.sources) assert_that(subject.source_files).equals(exp)