Sha256: dd38b819de3d88c2600998174eac61e27ab4a0d85561ec21b97f2186de546fc9

Contents?: true

Size: 808 Bytes

Versions: 15

Compression:

Stored size: 808 Bytes

Contents

require 'spec_helper'

describe LearnOpen::Opener do
  LearnOpen::Opener::HOME_DIR = File.join(__dir__, "..", "home_dir")

  context "Verifying repo existance" do
    let(:opener) { LearnOpen::Opener.new("","","") }
    after do
      path = File.join(__dir__, "..", "home_dir", "code")
      FileUtils.rm_rf(path)
    end

    it "returns true if .git directory for lab exists" do
      expect(opener).to receive(:repo_dir).and_return("js-rubber-duck-wrangling")
      FileUtils.mkdir_p("#{opener.lessons_dir}/js-rubber-duck-wrangling/.git")

      expect(opener.repo_exists?).to be_truthy
    end

    it "returns false if directory for lab doesn't exists" do
      expect(opener).to receive(:repo_dir).and_return("js-rubber-duck-wrangling")
      expect(opener.repo_exists?).to be_falsy
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
learn-open-1.2.20 spec/learn_open/opener_spec.rb
learn-open-1.2.19 spec/learn_open/opener_spec.rb
learn-open-1.2.18 spec/learn_open/opener_spec.rb
learn-open-1.2.17 spec/learn_open/opener_spec.rb
learn-open-1.2.16 spec/learn_open/opener_spec.rb
learn-open-1.2.15 spec/learn_open/opener_spec.rb
learn-open-1.2.14 spec/learn_open/opener_spec.rb
learn-open-1.2.13 spec/learn_open/opener_spec.rb
learn-open-1.2.12 spec/learn_open/opener_spec.rb
learn-open-1.2.11 spec/learn_open/opener_spec.rb
learn-open-1.2.10 spec/learn_open/opener_spec.rb
learn-open-1.2.9 spec/learn_open/opener_spec.rb
learn-open-1.2.8 spec/learn_open/opener_spec.rb
learn-open-1.2.7 spec/learn_open/opener_spec.rb
learn-open-1.2.6 spec/learn_open/opener_spec.rb