<commit_before>package bad.robot.temperature

import org.specs2.matcher.DisjunctionMatchers._
import org.specs2.mutable.Specification

class TemperatureTest extends Specification {

  "Celsius" >> {
    Temperature(23.125).celsius must_== 23.125
  }

  "Fahrenheit" >> {
    Temperature(23.125).fahrenheit must_== 73.625
  }

  "Encode json" >> {
    val expected =
      """{
        |  "celsius" : 66.99
        |}""".stripMargin
    encode(Temperature(66.99)).spaces2ps must_== expected
  }<commit_msg>#60 adding some tests around display fahrenheit<commit_after>package bad.robot.temperature

import org.specs2.matcher.DisjunctionMatchers._
import org.specs2.mutable.Specification

class TemperatureTest extends Specification {

  "Celsius" >> {
    Temperature(23.125).celsius must_== 23.125
  }

  "Fahrenheit" >> {
    Temperature(23.125).fahrenheit must_== 73.625
  }
  
  "Display as celsius" >> {
    Temperature(24.5).asCelsius must_== "24.5 °C"
  }

  "Display as fahrenheit" >> {
    Temperature(72.24).asFahrenheit must_== "162.0 °F"
  }

  "Encode json" >> {
    val expected =
      """{
        |  "celsius" : 66.99
        |}""".stripMargin
    encode(Temperature(66.99)).spaces2ps must_== expected
  }
{'fraction_non_alphanumeric': 0.14016393442622951, 'fraction_numerical': 0.06393442622950819, 'mean_word_length': 3.2842105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2273510', 'n_tokens_mistral': 498, 'n_tokens_neox': 426, 'n_words': 76}