Sha256: a4c93eb6188e4b16e19ff8871a57cd1daa73c212a7db491d7a012c407c224188

Contents?: true

Size: 991 Bytes

Versions: 1

Compression:

Stored size: 991 Bytes

Contents

require_relative './spec_helper'

describe MtGen::CLI do

  it "must create a test folder with test files in current directory" do
    random_folder = rand(36**10).to_s(36)
    folder_to_use = "/tmp/#{random_folder}"
    FileUtils.mkdir_p(folder_to_use)
    Dir.chdir(folder_to_use)
    
    MtGen::CLI.start(["test"])
    
    File.directory?("./test").must_equal true
    File.file?("./test/test_helper.rb").must_equal true
    File.file?("./test/sample_test.rb").must_equal true

    FileUtils.rm_rf(folder_to_use)
  end

  it "must create a spec folder with spec files in current directory" do
    random_folder = rand(36**10).to_s(36)
    folder_to_use = "/tmp/#{random_folder}"
    FileUtils.mkdir_p(folder_to_use)
    Dir.chdir(folder_to_use)

    MtGen::CLI.start(["spec"])
    
    File.directory?("./spec").must_equal true
    File.file?("./spec/spec_helper.rb").must_equal true
    File.file?("./spec/sample_spec.rb").must_equal true

    FileUtils.rm_rf(folder_to_use)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mtgen-0.2.0 spec/mtgen_spec.rb