Sha256: ba2b057fe46f6472ad49abb8d82cfe33df2b6bde2850dd3aa1ed71aae8991287

Contents?: true

Size: 678 Bytes

Versions: 6

Compression:

Stored size: 678 Bytes

Contents

require "spec_helper"

RSpec.describe "string" do
  let(:timeout) { 0 }
  subject { Code.evaluate(input, timeout: timeout).to_s }

  [
    ["''", ""],
    ['""', ""],
    %w[:hello hello],
    %w[:admin? admin?],
    %w[:update! update!],
    ["'Hello Dorian'", "Hello Dorian"],
    ['"Hello Dorian"', "Hello Dorian"],
    ["'Hello \\{name}'", "Hello {name}"],
    ['"Hello \\{name}"', "Hello {name}"],
    ["'Hello {1}'", "Hello 1"],
    ['"Hello {1}"', "Hello 1"],
    ['"Hello".include?("H")', "true"],
    ['"Hello".downcase', "hello"]
  ].each do |input, output|
    context input do
      let(:input) { input }
      it { expect(subject).to eq(output) }
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
template-ruby-0.5.6 spec/code/string_spec.rb
language-ruby-0.5.6 spec/code/string_spec.rb
code-ruby-0.5.6 spec/code/string_spec.rb
template-ruby-0.5.5 spec/code/string_spec.rb
language-ruby-0.5.5 spec/code/string_spec.rb
code-ruby-0.5.5 spec/code/string_spec.rb