我发现了我申请ruby代码的RSpec测试(参见falkorlib但我注意到字符串的显示方式不符合指令的顺序。
例如,对于此类测试(摘自spec/falkorlib/git_spec.rb
:
describe FalkorLib::Git do before :all do $stdout.sync = true end [...] it "#command? - check availability of git command 'init'" do c = FalkorLib::Git.command?('init') c.should be_true end it "#submodules_init" do FalkorLib.config.git do |c| c[:submodules] = { 'falkorgit' => { :url => 'https://github.com/Falkor/falkorlib.git', :branch => 'devel' } } end b = FalkorLib::Git.submodule_init( dir ) b.should == 0 end end
FalkorLib::Git.submodule_init
生成一些输出文本(已刷新),在<{1}}调用引入的文本之前打印:
[...] #command? - check availability of git command 'init' [Running] ------------------------ text produced by the call to submodule_init git submodule init git submodule update [INFO] Adding Git submodule '.submodules/falkorgit' from 'https://github.com/Falkor/falkorlib.git' [Running] git submodule add -b devel https://github.com/Falkor/falkorlib.git .submodules/falkorgit git commit -s -m "Add Git submodule '.submodules/falkorgit' from 'https://github.com/Falkor/falkorlib.git'" .gitmodules .submodules/falkorgit Cloning into '.submodules/falkorgit'... remote: Reusing existing pack: 380, done. remote: Counting objects: 62, done. remote: Compressing objects: 100% (62/62), done. remote: Total 442 (delta 29), reused 0 (delta 0) Receiving objects: 100% (442/442), 80.15 KiB | 0 bytes/s, done. Resolving deltas: 100% (229/229), done. Checking connectivity... done. [master 5655ff9] Add Git submodule '.submodules/falkorgit' from 'https://github.com/Falkor/falkorlib.git' 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 .submodules/falkorgit #submodules_init -------------------- the text of it "#submodule_init"
任何正确冲洗的提示? 如你所见,我试图在所有任务之前强制刷新,到目前为止没有成功。