github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/builtin/scriptpack/ruby/test/gemfile_contains.bats (about)

     1  #!/usr/bin/env bats
     2  
     3  # Load the main library
     4  . ${SCRIPTPACK_RUBY_ROOT}/main.sh
     5  
     6  @test "gemfile contains a gem" {
     7    # Write a test Gemfile
     8    local dir=$(mktemp -d)
     9    cd $dir
    10    cat <<EOF >Gemfile
    11  gem "nokogiri"
    12  EOF
    13  
    14    if ! ruby_gemfile_contains "nokogiri"; then
    15        echo "nokogiri not found"
    16        exit 1
    17    fi
    18  
    19    if ruby_gemfile_contains "foo"; then
    20        echo "foo should not be found"
    21        exit 1
    22    fi
    23  }