Sha256: 5fcfe0a203ca6c5930726884ee2c38aba85109af83fb5c73093b5ddc88de9b98

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 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::TypeError)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
code-ruby-1.1.3 spec/code/type_spec.rb
code-ruby-1.1.1 spec/code/type_spec.rb
code-ruby-1.1.0 spec/code/type_spec.rb