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.46 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.45 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.44 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.43 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.42 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.41 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.40 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.39 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.38 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.37 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.36 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.35 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.34 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.33 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.32 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.31 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.30 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.29 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.28 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh
trackler-2.2.1.27 tracks/bash/exercises/rna-transcription/rna_transcription_test.sh