Sha256: fb6c2568455b8f216d31e22d51b641bfc692f09149350f3775b311c0372a3eee

Contents?: true

Size: 1.11 KB

Versions: 268

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env bats

@test 'Complement of cytosine is guanine' {
  run bash rna_transcription.sh C

  [ "$status" -eq 0 ]
  [ "$output" == 'G' ]
}

@test 'Complement of guanine is cytosine' {
  run bash rna_transcription.sh G
  
  [ "$status" -eq 0 ]
  [ "$output" == 'C' ]
}

@test 'Complement of thymine is adenine' {
  run bash rna_transcription.sh T

  [ "$status" -eq 0 ]
  [ "$output" == 'A' ]
}

@test 'Complement of adenine is uracil' {
  run bash rna_transcription.sh A

  [ "$status" -eq 0 ]
  [ "$output" == 'U' ]
}

@test 'Complement of long string' {
  run bash rna_transcription.sh ACGTGGTCTTAA

  [ "$status" -eq 0 ]
  [ "$output" == 'UGCACCAGAAUU' ]
}

@test 'Handles invalid character' {
  run bash rna_transcription.sh U

  [ "$status" -eq 1 ]
  [ "$output" == 'Invalid nucleotide detected.' ]
}

@test 'Handles completely invalid string' {
  run bash rna_transcription.sh XXXX

  [ "$status" -eq 1 ]
  [ "$output" == 'Invalid nucleotide detected.' ]
}

@test 'Handles partially invalid string' {
  run bash rna_transcription.sh ACGTXCTTAA

  [ "$status" -eq 1 ]
  [ "$output" == 'Invalid nucleotide detected.' ]
}

Version data entries

268 entries across 268 versions & 1 rubygems

Version Path
trackler-2.2.1.66 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.65 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.64 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.63 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.62 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.61 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.60 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.59 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.58 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.57 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.56 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.55 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.54 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.53 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.52 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.51 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.50 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.49 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.48 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.47 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh