tins 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/Gemfile +2 -0
- data/README.md +25 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/examples/bb3.stm +15 -15
- data/examples/concatenate_compare.mtm +26 -26
- data/examples/length_difference.mtm +12 -12
- data/examples/let.rb +2 -2
- data/examples/ones_difference.mtm +7 -7
- data/examples/ones_difference.stm +19 -19
- data/examples/prefix-equals-suffix-reversed-with-infix.stm +33 -33
- data/examples/recipe_common.rb +0 -32
- data/lib/tins.rb +1 -2
- data/lib/tins/annotate.rb +1 -1
- data/lib/tins/ask_and_send.rb +16 -0
- data/lib/tins/case_predicate.rb +7 -0
- data/lib/tins/dslkit.rb +7 -54
- data/lib/tins/file_binary.rb +1 -3
- data/lib/tins/method_description.rb +4 -2
- data/lib/tins/null.rb +1 -1
- data/lib/tins/string_version.rb +1 -3
- data/lib/tins/terminal.rb +18 -10
- data/lib/tins/thread_local.rb +2 -3
- data/lib/tins/token.rb +4 -1
- data/lib/tins/version.rb +1 -1
- data/lib/tins/xt.rb +2 -1
- data/lib/tins/xt/case_predicate.rb +8 -0
- data/lib/tins/xt/dslkit.rb +0 -1
- data/lib/tins/xt/named.rb +14 -26
- data/lib/tins/{time_freezer.rb → xt/time_freezer.rb} +0 -0
- data/tests/ask_and_send_test.rb +14 -0
- data/tests/attempt_test.rb +0 -6
- data/tests/case_predicate_test.rb +29 -0
- data/tests/dslkit_test.rb +0 -2
- data/tests/if_predicate_test.rb +1 -1
- data/tests/method_description_test.rb +15 -2
- data/tests/test_helper.rb +4 -0
- data/tins.gemspec +7 -7
- metadata +23 -28
- data/examples/bb3_19.stm +0 -26
- data/examples/concatenate_compare_19.mtm +0 -31
- data/examples/length_difference_19.mtm +0 -17
- data/examples/ones_difference_19.mtm +0 -12
- data/examples/ones_difference_19.stm +0 -25
- data/examples/prefix-equals-suffix-reversed-with-infix_19.stm +0 -38
- data/lib/tins/round.rb +0 -51
- data/lib/tins/xt/round.rb +0 -13
- data/tests/round_test.rb +0 -32
data/lib/tins/xt/round.rb
DELETED
data/tests/round_test.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'tins/xt'
|
3
|
-
|
4
|
-
module Tins
|
5
|
-
class RoundTest < Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_standard
|
8
|
-
assert_equal(1, 1.round)
|
9
|
-
assert_equal(-1, -1.round)
|
10
|
-
assert_equal(2, 1.5.round)
|
11
|
-
assert_kind_of Integer, 1.5.round
|
12
|
-
assert_equal(-1, -1.4.round)
|
13
|
-
assert_equal(-2, -1.5.round)
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_inclusion
|
17
|
-
assert_equal(10, 12.round(-1))
|
18
|
-
assert_kind_of Integer, 12.round(-1)
|
19
|
-
assert_equal(-10, -12.round(-1))
|
20
|
-
assert_raises(ArgumentError) { 12.round(-2) }
|
21
|
-
assert_raises(ArgumentError) { -12.round(-2) }
|
22
|
-
assert_in_delta(1.6, 1.55.round(1), 1E-1)
|
23
|
-
assert_kind_of Float, 1.55.round(1)
|
24
|
-
assert_equal(2, 1.55.round(0))
|
25
|
-
assert_in_delta(-1.5, -1.45.round(1), 1E-1)
|
26
|
-
assert_equal(-1, -1.45.round(0))
|
27
|
-
assert_in_delta(-1.6, -1.55.round(1), 1E-1)
|
28
|
-
assert_equal(-2, -1.55.round(0))
|
29
|
-
assert_in_delta(-1.55, -1.55.round(999), 1E-2)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|