Sha256: 089a84fec2e1a18ab86b182c2b169c5baed63767f50bfaadbe5c78f9e2efe25b

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 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

  config.before :each do
    GC.stress = true
  end

  config.after :each do
    GC.stress = false
  end
end

configure do
  set :env, 'test'
end

# todo a test helper to compile routes after app loaded

Version data entries

2 entries across 2 versions & 1 rubygems

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