Sha256: ec1e988f820dbe23ce199bc99c8c056850672b7b02842a64beee16d47b8ec1d6

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'ripper-plus'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec::Matchers.define :transform_to do |output|
  match do |input|
    RipperPlus::Transformer.transform(input) == output
  end

  diffable
end

def dfs_for_node_type(tree, type)
  if tree[0] == type
    return tree
  else
    tree.select { |child| Array === child }.each do |child|
      result = dfs_for_node_type(child, type)
      return result if result
    end
  end
  nil
end

RSpec.configure do |config|
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ripper-plus-1.1.0.pre2 spec/spec_helper.rb