b0VIM 7.4hW"\danok~dan/dev/gems/whirly/spec/whirly_spec.rbutf-8 3210#"! Utp{ad dvrq`TPO@621[   ~ } ; } w v W '  X P O .  > h ` _  poD<;jXFEphg|{,rN >da Whirly.start(spinner: ["A", "B"]) it "can be an Array of frames" do end assert_match /⠋/, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: "dots3") it "can be the name of a bundled spinner (cli-spinners)" do end assert_match /✎/, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: "pencil") it "can be the name of a bundled spinner (whirly-spinners)" do describe "Passing a Spinner" do describe "Spinner" do end end assert_match /\e8\n\z/, @capture.string Whirly.stop short_sleep Whirly.start(hide_cursor: false, remove_after_stop: true) it "removes the spinner after stopping when :remove_after_stop is true" do end assert_match /[^\n]\z/, @capture.string Whirly.stop short_sleep Whirly.start(hide_cursor: false, append_newline: false) it "appends no newline when stopping when :append_newline option is false" do end assert_match /\n\z/, @capture.string Whirly.stop short_sleep Whirly.start(hide_cursor: false) it "appends newline when stopping" do end assert_match /STOP/, @capture.string Whirly.stop short_sleep Whirly.start(spinner: spinner, stop: "STOP") spinner = { "frames" => ["first", "second", "third"], "interval" => 5 } it "shows spinner finished frame if stop frame is passed when starting" do end assert_match /STOP/, @capture.string Whirly.stop("STOP") short_sleep Whirly.start(spinner: spinner) spinner = { "frames" => ["first", "second", "third"], "interval" => 5 } it "shows spinner finished frame if stop frame is passed when stopping" do end assert_match /STOP/, @capture.string Whirly.stop short_sleep Whirly.start(spinner: spinner) spinner = { "frames" => ["first", "second", "third"], "stop" => "STOP", "interval" => 5 } it "shows spinner finished frame if stop is set in spinner definition" do describe "Finishing" do end end assert_match /Initial/, @capture.string Whirly.stop short_sleep Whirly.start(status: "Initial") it "shows initial status" do end assert_match /Fetching.*Updates…/m, @capture.string Whirly.stop medium_sleep Whirly.status = "Updates…" medium_sleep Whirly.status = "Fetching…" Whirly.start it "shows status text alongside spinner" do describe "Status Updates" do end end assert_match /frame/, @capture.string Whirly.stop short_sleep Whirly.start(spinner: spinner) spinner = { "proc" => ->(){ "frame" }, "interval" => 5 } it "calls spinner proc instead of frames if proc is given" do end assert_match /first.*second.*third/m, @capture.string Whirly.stop short_sleep Whirly.start(spinner: spinner) spinner = { "frames" => ["first", "second", "third"], "interval" => 5 } it "outputs every frame of the spinner" do describe "General Usage" do end Whirly.configure(non_tty: true, stream: @capture) @capture = StringIO.new Whirly.reset before dodescribe Whirly doend sleep 1def long_sleepend sleep 0.5def medium_sleepend sleep 0.15def short_sleeprequire "stringio"# require "irbtools/binding"require "minitest/autorun"require_relative "../lib/whirly"ad{pH3nZY*  ^ I 5 4 w v O : & % h g @ +   *   ` 3  Q+s?>+yfe1 zQIH}jX/'!eend end end refute_predicate Whirly, :enabled? Whirly.stop Whirly.start it "returns false if whirly was stopped" do end Whirly.stop assert_predicate Whirly, :enabled? Whirly.start it "returns true if whirly was started, but not yet stopped" do end refute_predicate Whirly, :enabled? it "returns false if whirly was not started yet" do describe ".enabled?" do end end assert_match /\A[^⠧]+\z/, @capture.string Whirly.stop short_sleep Whirly.start(non_tty: true, stream: @capture) Whirly.reset Whirly.configure spinner: "dots", interval: 5 it "can be reset using .reset" do end assert_match /⠧/, @capture.string Whirly.stop short_sleep Whirly.start Whirly.configure spinner: "dots", interval: 5 it "can be configured before starting" do describe "Configure and Reset" do end end assert_match /\n.*\e\[1A/m, @capture.string Whirly.stop short_sleep Whirly.start(position: "below") it "will render spinner 1 line further below (useful for spinning while git cloning)" do describe "Positioning" do end end assert_match /\e\[G.*\e\[1K/m, @capture.string Whirly.stop medium_sleep Whirly.start(ansi_escape_mode: 'line') it "will use beginning of line and clear line ANSI sequences when 'line' is given" do end assert_match /\e7.*\e8/m, @capture.string Whirly.stop short_sleep Whirly.start it "will use save and restore ANSI sequences as default (or when 'restore') is given" do describe "Ansi Escape Mode" do end end end assert_match /A.*B.*C.*D.*E.*F.*G.*H.*G.*F.*E.*D.*C.*B.*A/m, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: spinner) spinner = { "frames" => "A".."H", "mode" => "swing", "interval" => 10 } it "can be set to swing" do end assert_match /H.*G.*F.*E.*D.*C.*B.*A/m, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: spinner) spinner = { "frames" => "A".."H", "mode" => "reverse", "interval" => 10 } it "can be set to reverse" do end refute /A.*B.*C.*D.*E.*F.*G.*H/m =~ @capture.string Whirly.stop medium_sleep Whirly.start(spinner: spinner) spinner = { "frames" => "A".."H", "mode" => "random", "interval" => 10 } it "can be set to random" do describe "Frame Mode" do end end assert_match /frame/m, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: ->(){ "frame" }) it "can be a Proc which generates frames" do end assert_match /A.*B/m, @capture.string Whirly.stop medium_sleep Whirly.start(spinner: "A".."B") it "can be an Enumerator of frames" do end assert_match /A.*B/m, @capture.string Whirly.stop medium_sleep