gravitheque 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,32 +0,0 @@
1
- require "./test/test_helper"
2
- require "conversions/extract"
3
-
4
- describe Convert do
5
-
6
- it "must convert specific gravity to Plato" do
7
- (Convert.specific_gravity_to_plato 1.055).must_equal 13.5
8
- end
9
-
10
- it "must convert Brix to specific gravity" do
11
- (Convert.brix_to_specific_gravity 16.2).must_equal 1.067
12
- end
13
-
14
- it "must convert terminal Brix to terminal gravity" do
15
- (Convert.terminal_brix_to_terminal_gravity 16.2, 7.8).must_equal 1.009
16
- end
17
-
18
- it "must convert Plato to specific gravity" do
19
- (Convert.plato_to_specific_gravity 18.9).must_equal 1.078
20
- end
21
-
22
- it "must convert specific gravity to temperature corrected specific gravity" do
23
- (Convert.specific_gravity_to_temperature_corrected_gravity 1.064, 2).must_equal 1.063
24
- (Convert.specific_gravity_to_temperature_corrected_gravity 1.064, 42).must_equal 1.072
25
- (Convert.specific_gravity_to_temperature_corrected_gravity 1.055, 12, :celsius).must_equal 1.068
26
- end
27
-
28
- it "must raise an exception when the temperature unit for specific gravity to temperature corrected specific gravity is not recognized" do
29
- lambda { Convert.specific_gravity_to_temperature_corrected_gravity 1.055, 12, :kelvin }.must_raise ArgumentError
30
- end
31
-
32
- end
@@ -1,22 +0,0 @@
1
- require "./test/test_helper"
2
- require "conversions/mass"
3
-
4
- describe Convert do
5
-
6
- it "must convert grams to ounces" do
7
- (Convert.grams_to_ounces 56).must_equal 2.0
8
- end
9
-
10
- it "must convert ounces to grams" do
11
- (Convert.ounces_to_grams 2).must_equal 56.7
12
- end
13
-
14
- it "must convert kilograms to pounds" do
15
- (Convert.kilograms_to_pounds 10).must_equal 22.0
16
- end
17
-
18
- it "must convert pounds to kilograms" do
19
- (Convert.pounds_to_kilograms 10).must_equal 4.5
20
- end
21
-
22
- end
@@ -1,18 +0,0 @@
1
- require "./test/test_helper"
2
- require "conversions/temperature"
3
-
4
- describe Convert do
5
-
6
- it "must convert Celsius to Fahrenheit" do
7
- (Convert.celsius_to_fahrenheit 0).must_equal 32.0
8
- (Convert.celsius_to_fahrenheit 50).must_equal 122.0
9
- (Convert.celsius_to_fahrenheit 100).must_equal 212.0
10
- end
11
-
12
- it "must convert Fahrenheit to Celsius" do
13
- (Convert.fahrenheit_to_celsius 32).must_equal 0.0
14
- (Convert.fahrenheit_to_celsius 90).must_equal 32.2
15
- (Convert.fahrenheit_to_celsius 212).must_equal 100.0
16
- end
17
-
18
- end
@@ -1,22 +0,0 @@
1
- require "./test/test_helper"
2
- require "conversions/volume"
3
-
4
- describe Convert do
5
-
6
- it "must convert gallons to liters" do
7
- (Convert.gallons_to_liters 5).must_equal 18.9
8
- end
9
-
10
- it "must convert liters to gallons" do
11
- (Convert.liters_to_gallons 19).must_equal 5.0
12
- end
13
-
14
- it "must convert liters to quarts" do
15
- (Convert.liters_to_quarts 19).must_equal 20.1
16
- end
17
-
18
- it "must convert quarts to liters" do
19
- (Convert.quarts_to_liters 20).must_equal 18.9
20
- end
21
-
22
- end
@@ -1,25 +0,0 @@
1
- # Rubinius does not yet have the 1.9 Coverage module
2
- unless RUBY_ENGINE == "rbx"
3
- require "simplecov"
4
-
5
- class SimpleCov::Formatter::NoHTMLFormatter
6
- def format result
7
- puts "\n#{result.covered_percent.round}% test coverage"
8
- end
9
- end
10
-
11
- SimpleCov.start do
12
- @formatter = ENV["CI"] ? SimpleCov::Formatter::NoHTMLFormatter : SimpleCov::Formatter::HTMLFormatter
13
- end
14
-
15
- yard_stats = `yard stats --list-undoc 2>&1`
16
- if yard_stats =~ /100.00%/
17
- puts "100% documentation coverage\n\n"
18
- else
19
- puts yard_stats
20
- end
21
- end
22
-
23
- $:.push File.expand_path "../../lib", __FILE__
24
-
25
- require "minitest/autorun"