Sha256: 951bd8f190f5fc9ed431ea50e985f1bbfaac6a68698560baf10a9dbcd3a851c4

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

require_relative "../lib/nyara/nyara"
require 'rspec/core'
require 'rspec/mocks'
require 'rspec/autorun'
require "pry"
require "slim"
require "erb"
require "haml"
require "liquid"

RSpec.configure do |config|
  config.expect_with :stdlib
  if config.formatters.first.class.to_s =~ /TextMate/
    def puts *xs
      xs.each do |x|
        $stdout.puts "<pre style='word-wrap:break-word;word-break:break-all;'>#{CGI.escape_html x.to_s}</pre>"
      end
      nil
    end

    def print *xs
      $stdout.print "<span style='word-wrap:break-word;word-break:break-all;'>"
      xs.each do |x|
        $stdout.print CGI.escape_html x.to_s
      end
      $stdout.print "</span>"
      nil
    end

    def p *xs
      xs.each do |x|
        $stdout.puts "<pre style='word-wrap:break-word;word-break:break-all;'>#{CGI.escape_html x.inspect}</pre>"
      end
      xs
    end

    require 'pp'
    module Kernel
      def pp obj
        s = CGI.escape_html(PP.pp obj, '')
        $stdout.puts "<pre style='word-wrap:break-word;word-break:break-all;'>#{s}</pre>"
        obj
      end
    end
  end
end

configure do
  set :env, 'test'
end

# todo a test helper to compile routes after app loaded

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nyara-0.0.1.pre spec/spec_helper.rb