dir = File.dirname __FILE__ crystal_dir = File.expand_path "#{dir}/../.." lib_dir = "#{crystal_dir}/lib" $LOAD_PATH << lib_dir unless $LOAD_PATH.include? lib_dir require 'crystal/http' require 'crystal/router' require 'spec_ext' require 'crystal/spec/environment' Spec::Example::ExampleGroup.class_eval do def self.with_router_spec before :all do crystal.after :environment do crystal.register :router, :depends_on => :environment do Crystal::Router.new(:class, [[:default_router, Crystal::DefaultRouter.new]]) end crystal.conveyors.web.use Crystal::Processors::Router, :class_variable, :method_variable end end end end