Sha256: 86d33d54fc3bb31b482edbec2b6a82acfc6cd81d4f3e8246eb6360c57d12341a
Contents?: true
Size: 976 Bytes
Versions: 1
Compression:
Stored size: 976 Bytes
Contents
require "#{File.expand_path(File.dirname(__FILE__))}/controller_helper" require 'crystal_ext/user_error' require 'crystal_ext/controller_helper' describe "User Error" do with_environment :test with_controller_ext_spec # before :all do # crystal[:config].environment = :test # crystal[:environment] = Crystal::Environment.new # crystal[:environment].load :controller_ext_spec # end after :all do # Micon.clear remove_constants %w(UserErrorSpec) end it "user error" do class ::UserErrorSpec inherit Crystal::HttpController def call raise_user_error "some error" end protected def catch_user_error begin yield rescue UserError => ue render :inline => "Catched #{ue.message}" end end around :catch_user_error end ccall(UserErrorSpec, :call).content.should == "Catched some error" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
crystal_ext-0.0.4 | spec/user_error_spec.rb |