Sha256: 29eaaba448d41cbca64a23b83a426dcc4d0747cde17bd76498bd547975a84aab

Contents?: true

Size: 981 Bytes

Versions: 8

Compression:

Stored size: 981 Bytes

Contents

require 'spec_helper'

describe Shelr::Recorder do

  before(:each) do
    STDIN.stubs(:gets).returns('my shellcast')
  end

  describe "#record!" do

    before(:each) do
      subject.stubs(:system).with(anything).returns(true)
    end

    it "should set tty to 80x24" do
      subject.expects("system").with(regexp_matches(/stty columns 80 rows 24/))
      subject.record!
    end

    it "should restore tty to user defined values" do
      subject.expects(:restore_terminal)
      subject.record!
    end

    it "should start script session" do
      subject.expects("system").with(regexp_matches Regexp.compile("script -c 'bash'"))
      subject.record!
    end
  end

  describe "#restore_terminal" do
    it "should call tty with saved dimensions" do
      subject.expects(:system).with(
        all_of(regexp_matches(/stty/),
               regexp_matches(/columns/),
               regexp_matches(/rows/))
      )
      subject.send :restore_terminal
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shelr-0.11.2 spec/shelr/recorder_spec.rb
shelr-0.11.1 spec/shelr/recorder_spec.rb
shelr-0.11.0 spec/shelr/recorder_spec.rb
shelr-0.10.0 spec/shelr/recorder_spec.rb
shelr-0.9.10 spec/shelr/recorder_spec.rb
shelr-0.9.9 spec/shelr/recorder_spec.rb
shelr-0.9.8 spec/shelr/recorder_spec.rb
shelr-0.9.7 spec/shelr/recorder_spec.rb