Sha256: 313c15f62a537b3ae8cdb8b9b8ad948d28b0e9597e617a919c2d5dae763e2029
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
require 'rib/test' require 'rib/test/history' require 'rib/core/squeeze_history' describe Rib::SqueezeHistory do paste :rib paste :setup_history test_for Rib::History, Rib::SqueezeHistory do before do @input = %w[foo bar bar foo bar] end would 'after_loop saves squeezed history' do shell.history.push(*@input) shell.after_loop expect(File.read(history_file)).eq %w[foo bar foo bar].join("\n") + "\n" end would 'loop_once squeeze history' do stub_output stub(shell).get_input{ (shell.history << "'#{@input.shift}'").last } @input.size.times{ shell.loop_once } expect(shell.history.to_a).eq %w[foo bar foo bar].map{ |i| "'#{i}'" } end would 'be disabled if disabled' do Rib::SqueezeHistory.disable do stub_output stub(shell).get_input{ (shell.history << "'#{@input.shift}'").last } input = @input.dup @input.size.times{ shell.loop_once } expect(shell.history.to_a).eq input.map{ |i| "'#{i}'" } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rib-1.6.1 | test/core/test_squeeze_history.rb |
rib-1.6.0 | test/core/test_squeeze_history.rb |