Sha256: abc37a54d8488b8cdae91b8109f0b29f0e2a59ddeb29e0902a12cfe7c405ee6e

Contents?: true

Size: 802 Bytes

Versions: 26

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

require 'helper'
require 'open3'

class TestRunnerParse < Minitest::Test
  PATH_TO_RUBY_PARSE = File.expand_path('../bin/ruby-parse', __dir__).freeze

  def assert_prints(argv, expected_output)
    stdout, stderr, status = Open3.capture3(PATH_TO_RUBY_PARSE, *argv)

    assert_equal 0, status.to_i
    assert_includes(stdout, expected_output)
  end

  def test_emit_ruby
    assert_prints ['--emit-ruby', '-e 123'],
                  's(:int, 123)'
  end

  def test_emit_json
    assert_prints ['--emit-json', '-e', '123'],
                  '["int",123]'
  end

  def test_emit_ruby_empty
    assert_prints ['--emit-ruby', '-e', ''],
                  "\n"
  end

  def test_emit_json_empty
    assert_prints ['--emit-json', '-e', ''],
                  "\n"
  end
end

Version data entries

26 entries across 20 versions & 4 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/parser-2.7.0.2/test/test_runner_parse.rb
parser-2.7.1.2 test/test_runner_parse.rb
parser-2.7.1.1 test/test_runner_parse.rb
talon_one-2.0.0 vendor/bundle/ruby/2.7.0/gems/parser-2.7.1.0/test/test_runner_parse.rb
talon_one-2.0.0 vendor/bundle/ruby/2.3.0/gems/parser-2.7.1.0/test/test_runner_parse.rb
parser-2.7.1.0 test/test_runner_parse.rb
parser-2.7.0.5 test/test_runner_parse.rb
parser-2.7.0.4 test/test_runner_parse.rb
parser-2.7.0.3 test/test_runner_parse.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/parser-2.7.0.2/test/test_runner_parse.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.6.0/gems/parser-2.7.0.2/test/test_runner_parse.rb
parser-2.7.0.2 test/test_runner_parse.rb
parser-2.7.0.1 test/test_runner_parse.rb
parser-2.7.0.0 test/test_runner_parse.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/parser-2.6.4.1/test/test_runner_parse.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/parser-2.6.5.0/test/test_runner_parse.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/parser-2.6.4.1/test/test_runner_parse.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/parser-2.6.5.0/test/test_runner_parse.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/parser-2.6.4.1/test/test_runner_parse.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/parser-2.6.5.0/test/test_runner_parse.rb