Sha256: a4b49d7c3a2838454ce26df37ca082dc081d44a9a3ae6c85273419fca08923bc

Contents?: true

Size: 738 Bytes

Versions: 22

Compression:

Stored size: 738 Bytes

Contents

require 'spec_helper'

require "shellplay/screen"

describe Shellplay::Screen, "A typical screen element" do

  let(:goodhash) {
    {
      "timespent" => 0.123,
      "stdin" => "ls -1",
      "stdout" => "bin\nCHANGELOG.md\nGemfile\n"
    }
  }

  subject { Shellplay::Screen.new }

  describe ".import" do

    context "when we import a valid hash, " do
      before  { subject.import(goodhash) }
      it "fills up instance variables from a hash" do
        expect(subject.stdin).to eq goodhash['stdin']
      end
    end

    context "when we import an empty hash, " do
      before  { subject.import({}) }
      it "inits the variables with false values" do
        expect(subject.stdin).to be_falsey
      end
    end

  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shellplay-0.1.9 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.8 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.7 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.6 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.5 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.4 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.3 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.2 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.1 spec/lib/shellplay/screen_spec.rb
shellplay-0.1.0 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.13 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.12 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.11 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.10 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.9 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.8 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.7 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.6 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.5 spec/lib/shellplay/screen_spec.rb
shellplay-0.0.4 spec/lib/shellplay/screen_spec.rb