Sha256: 5cac5564448f72a3c51731ec0986209ac621fcbca9b400a368904b9e45204cad

Contents?: true

Size: 879 Bytes

Versions: 6

Compression:

Stored size: 879 Bytes

Contents

require 'spec_helper'

require "shellplay/session"

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

  let(:basedir) { File.expand_path('../../../files/config', __FILE__) }
  let(:basefile) { 'session.json' }
  let(:input) { StringIO.new }
  let(:output) { StringIO.new }
  subject { Shellplay::Session.new(basedir, basefile, 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('session') }
      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

6 entries across 6 versions & 1 rubygems

Version Path
shellplay-0.1.6 spec/lib/shellplay/session_spec.rb
shellplay-0.1.5 spec/lib/shellplay/session_spec.rb
shellplay-0.1.4 spec/lib/shellplay/session_spec.rb
shellplay-0.1.3 spec/lib/shellplay/session_spec.rb
shellplay-0.1.2 spec/lib/shellplay/session_spec.rb
shellplay-0.1.1 spec/lib/shellplay/session_spec.rb