Sha256: 84b0befe277bfe772f3781b6ec7174ebc035aa205a9d73d8624e9eef77095f7d

Contents?: true

Size: 1.23 KB

Versions: 58

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe Code::Node::Call do
  #   let(:context) { <<~CONTEXT }
  #     render = (*args, **kargs, &block) => {
  #       [args, kargs, block&.call(:dorian)]
  #     }
  #
  #     { render:, user: { name: :Dorian } }"
  #   CONTEXT
  #
  #   [
  #     ["render", "[[], {}, nothing]"],
  #     ["render()", "[[], {}, nothing]"],
  #     ["render(user)", "[[user], {}, nothing]"],
  #     [
  #       "render(user, first_name: :Dorian)",
  #       "[[user], { first_name: :Dorian }, nothing]"
  #     ],
  #     ["render { }", "[[], {}, nothing]"],
  #     ["render do end", "[[], {}, nothing]"],
  #     ["render { |name| name.upcase }", "[[], {}, :Dorian]"],
  #     ["render(user) { |name| name.upcase }", "[[user], {}, :Dorian]"],
  #     ["render(user) do |name| name.upcase end", "[[user], {}, :Dorian]"],
  #     ["render { :Dorian }", "[[], {}, :Dorian]"],
  #     ["render(user) { :Dorian }", "[[user], {}, :Dorian]"],
  #     ["render(user) do :Dorian end", "[[user], {}, :Dorian]"]
  #   ].each do |input, expected|
  #     it "#{input} == #{expected}" do
  #       expect(Code.evaluate(input, context)).to eq(
  #         Code.evaluate(expected, context)
  #       )
  #     end
  #   end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
code-ruby-1.0.0 spec/code/node/call_spec.rb
code-ruby-0.15.16 spec/code/node/call_spec.rb
code-ruby-0.15.15 spec/code/node/call_spec.rb
code-ruby-0.15.14 spec/code/node/call_spec.rb
code-ruby-0.15.13 spec/code/node/call_spec.rb
code-ruby-0.15.12 spec/code/node/call_spec.rb
code-ruby-0.15.11 spec/code/node/call_spec.rb
code-ruby-0.15.10 spec/code/node/call_spec.rb
code-ruby-0.15.9 spec/code/node/call_spec.rb
code-ruby-0.15.8 spec/code/node/call_spec.rb
code-ruby-0.15.7 spec/code/node/call_spec.rb
code-ruby-0.15.6 spec/code/node/call_spec.rb
code-ruby-0.15.5 spec/code/node/call_spec.rb
code-ruby-0.15.4 spec/code/node/call_spec.rb
code-ruby-0.15.3 spec/code/node/call_spec.rb
code-ruby-0.15.2 spec/code/node/call_spec.rb
code-ruby-0.15.0 spec/code/node/call_spec.rb
code-ruby-0.14.9 spec/code/node/call_spec.rb
code-ruby-0.14.8 spec/code/node/call_spec.rb
code-ruby-0.14.6 spec/code/node/call_spec.rb