Sha256: 3b685984844b9d567443f25bcd92c0fe541ca89ebf79b540155d3b9d0ff50ca9

Contents?: true

Size: 865 Bytes

Versions: 10

Compression:

Stored size: 865 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

module ActiveRecord; Errors = Struct.new(nil); end

describe Scintillation::SessionMessages do
  it "should add/get messages" do
    sm = Scintillation::SessionMessages.new({})
    
    sm.add("a")
    sm.add("b", 'x')
    sm.add("c", nil, 'y')
    sm.add("d", 'x', 'y')
    
    messages = sm.get
    messages.size.should == 2
    messages.map { |m| [m.to_s, m.tone] }.should == [['a', nil], ['b', 'x']]
    
    messages = sm.get('z')
    messages.size.should == 0
    
    messages = sm.get('y')
    messages.size.should == 2
    messages.map { |m| [m.to_s, m.tone] }.should == [['c', nil], ['d', 'x']]
  end
end

describe Scintillation::Message do
  it "should create" do
    m = Scintillation::Message.new("message", 'positive')
    [m.to_s, m.tone].should == ['message', 'positive']
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
scintillation-1.0.11 spec/scintillation_spec.rb
scintillation-1.0.10 spec/scintillation_spec.rb
scintillation-1.0.9 spec/scintillation_spec.rb
scintillation-1.0.8 spec/scintillation_spec.rb
scintillation-1.0.7 spec/scintillation_spec.rb
scintillation-1.0.6 spec/scintillation_spec.rb
scintillation-1.0.5 spec/scintillation_spec.rb
scintillation-1.0.3 spec/scintillation_spec.rb
scintillation-1.0.1 spec/scintillation_spec.rb
scintillation-1.0.0 spec/scintillation_spec.rb