Sha256: 4b59bcaf92049afb2b5d5a0e2695e4dae9d9909d2e9e98ada54f5077cd7468b0

Contents?: true

Size: 784 Bytes

Versions: 9

Compression:

Stored size: 784 Bytes

Contents

require 'pione/test-helper'

describe 'Pione::Lang::Message' do
  before do
    @a = Lang::Message.new("next", Lang::IntegerSequence.of(1), [])
    @b = Lang::Message.new("substring", Lang::StringSequence.of("abcdefg"), [Lang::IntegerSequence.of(2), Lang::IntegerSequence.of(3)])
  end

  it 'should equal' do
    @a.should == Lang::Message.new("next", Lang::IntegerSequence.of(1), [])
    @b.should == Lang::Message.new("substring", Lang::StringSequence.of("abcdefg"), [Lang::IntegerSequence.of(2), Lang::IntegerSequence.of(3)])
  end

  it 'should not equal' do
    @a.should.not == @b
  end

  it 'should send message' do
    @a.eval(Lang::Environment.new).should == Lang::IntegerSequence.of(2)
    @b.eval(Lang::Environment.new).should == Lang::StringSequence.of("bcd")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/lang/spec_message.rb
pione-0.5.0.alpha.2 test/lang/spec_message.rb
pione-0.5.0.alpha.1 test/lang/spec_message.rb
pione-0.4.2 test/lang/spec_message.rb
pione-0.4.1 test/lang/spec_message.rb
pione-0.4.0 test/lang/spec_message.rb
pione-0.3.2 test/lang/spec_message.rb
pione-0.3.1 test/lang/spec_message.rb
pione-0.3.0 test/lang/spec_message.rb