Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a26e237f91
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (18 sloc) 0.505 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
require 'spec_helper'

require 'parslet/rig/rspec'

describe Wt::Parser do
  let(:parser) { described_class.new }
  
  context "simple arithmetic expressions" do
    subject { parser.expression }
    it { should parse("1+2") }
    it { should parse("1-2") }
    it { should parse("1*2") }
    it { should parse("1/2") }
    it { should parse('1*2 + 3') }
    it { should parse('1 * (1 + 3)') }
  end
  
  context "assignment" do
    subject { parser.expression }
    it { should parse('a = 1') }
  end
end
Something went wrong with that request. Please try again.