lib/hanami/generators/test_framework.rb in hanami-0.8.0 vs lib/hanami/generators/test_framework.rb in hanami-0.9.0

- old
+ new

@@ -2,11 +2,11 @@ module Hanami module Generators class TestFramework RSPEC = 'rspec'.freeze MINITEST = 'minitest'.freeze - VALID_FRAMEWORKS = [RSPEC, MINITEST].freeze + VALID_FRAMEWORKS = [MINITEST, RSPEC].freeze attr_reader :framework def initialize(hanamirc, framework) @framework = (framework || hanamirc.options.fetch(:test)) @@ -23,15 +23,16 @@ private def assert_framework! if !supported_framework? - raise ArgumentError.new("Unknown test framework '#{ framework}'. Please use one of #{ valid_test_frameworks.join(', ')}") + warn "`#{framework}' is not a valid test framework. Please use one of: #{valid_test_frameworks.join(', ')}" + exit(1) end end def valid_test_frameworks - VALID_FRAMEWORKS.map { |name| "'#{ name }'"} + VALID_FRAMEWORKS.map { |name| "`#{name}'"} end def supported_framework? VALID_FRAMEWORKS.include?(framework) end