Sha256: c53041c8a986dcfedae6300b45766af5238d27144e158fc89bc7c5963aa58764

Contents?: true

Size: 836 Bytes

Versions: 13

Compression:

Stored size: 836 Bytes

Contents

require 'spec_helper'

require "shellplay/session"

describe Shellplay::Session, "A shellplay session" do

  let(:sessionfile) { File.expand_path('../../../files/session.json', __FILE__)}
  let(:input) { StringIO.new }
  let(:output) { StringIO.new }
  subject { Shellplay::Session.new(input, output) }

  describe '.new' do
    context 'when there is no prior configuration file, ' do
    end
  end

  describe ".import" do

    context "when we import a valid file, " do
      before  { subject.import(sessionfile) }
      it "fills up instance variables from the file" do
        expect(subject.title).to eq "test prez"
      end
    end

    context "when we import an invalid file, " do
      it "should break and throw exception" do
        expect { subject.import('/file/notfound') }.to raise_error
      end
    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shellplay-0.1.0 spec/lib/shellplay/session_spec.rb
shellplay-0.0.13 spec/lib/shellplay/session_spec.rb
shellplay-0.0.12 spec/lib/shellplay/session_spec.rb
shellplay-0.0.11 spec/lib/shellplay/session_spec.rb
shellplay-0.0.10 spec/lib/shellplay/session_spec.rb
shellplay-0.0.9 spec/lib/shellplay/session_spec.rb
shellplay-0.0.8 spec/lib/shellplay/session_spec.rb
shellplay-0.0.7 spec/lib/shellplay/session_spec.rb
shellplay-0.0.6 spec/lib/shellplay/session_spec.rb
shellplay-0.0.5 spec/lib/shellplay/session_spec.rb
shellplay-0.0.4 spec/lib/shellplay/session_spec.rb
shellplay-0.0.3 spec/lib/shellplay/session_spec.rb
shellplay-0.0.2 spec/lib/shellplay/session_spec.rb