require_relative "../spec_helper.rb" describe YSI::WorkingDirectory do describe "#status" do it "clean" do a = YSI::WorkingDirectory.new(YSI::Engine) git_output = <..." to include in what will be committed) # # hello nothing added to commit but untracked files present (use "git add" to track) EOT allow(a).to receive(:git_status).and_return(git_output) expect(a.status).to eq("untracked files") end it "uncommitted changes" do a = YSI::WorkingDirectory.new(YSI::Engine) git_output = <..." to unstage) # # new file: hello # EOT allow(a).to receive(:git_status).and_return(git_output) expect(a.status).to eq("uncommitted changes") end it "unstaged changes" do a = YSI::WorkingDirectory.new(YSI::Engine) git_output = <..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # # modified: README.md # no changes added to commit (use "git add" and/or "git commit -a") EOT allow(a).to receive(:git_status).and_return(git_output) expect(a.status).to eq("unstaged changes") end end end