Sha256: 3b5c5cbda4c1d2f2e1d9568b46de325e33cdd0257f15ff73f79b03b97ff88ff5

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

require 'spec_helper'

describe Xdrgen::Generators do
  languages = %w(ruby javascript go java elixir)
  focus_language = "" #"go"
  focus_basename = "" #"optional.x"

  generator_fixture_paths.each do |path|
    languages.each do |lang|
      next if focus_basename.present? && File.basename(path) != focus_basename
      next if focus_language.present? && lang != focus_language

      it "can generate #{File.basename path} in #{lang}" do
        c = generate lang, path
      end

    end
  end

  def generate(language, path)
    compilation = Xdrgen::Compilation.new(
        [path],
        output_dir: "tmp/generator_spec_#{language}/#{File.basename path}",
        language:   language,
        namespace:  "MyXDR"
      )
    compilation.compile
    compilation
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xdrgen-0.1.1 spec/lib/xdrgen/generator_spec.rb
xdrgen-0.1.0 spec/lib/xdrgen/generator_spec.rb
xdrgen-0.0.1 spec/lib/xdrgen/generator_spec.rb