Sha256: ecbe49744d44b75a4fca4ab9aaa48e6593c98dc706843ea494a1a30c3544f18f

Contents?: true

Size: 429 Bytes

Versions: 5

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe Code::Type do
  describe "valid" do
    ["1 + 2", "2 * 3.4"].each do |input|
      it input do
        expect { Code.evaluate(input) }.not_to raise_error
      end
    end
  end

  describe "invalid" do
    ["1 - :a", "2 * true"].each do |input|
      it input do
        expect { Code.evaluate(input) }.to raise_error(Code::Error)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
code-ruby-1.2.5 spec/code/type_spec.rb
code-ruby-1.2.4 spec/code/type_spec.rb
code-ruby-1.2.3 spec/code/type_spec.rb
code-ruby-1.2.2 spec/code/type_spec.rb
code-ruby-1.2.1 spec/code/type_spec.rb