Skip to content

Commit 8967624

Browse files
committed
Rename unit and add task and specs
1 parent 91913c7 commit 8967624

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# e.g.:
2+
fixnum = 5
3+
bignum = 100_000_000_000_000_000_000
4+
rational = Rational(2, 7)
5+
complex = Complex(0.1, 2.5)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'rspec'
2+
3+
describe "Your code" do
4+
[['solution::code']]
5+
6+
{
7+
'fixnum' => Fixnum,
8+
'bignum' => Bignum,
9+
'rational' => Rational,
10+
'complex' => Complex
11+
}.each do |variable, class_name|
12+
it "defines a variable with name \"#{variable}\"" do
13+
expect(!!defined?(send(variable))).to be true
14+
end
15+
16+
if defined?(send(variable))
17+
it "defines a variable \"#{variable}\" which is a #{class_name}" do
18+
expect(eval(variable).class).to eq class_name
19+
end
20+
end
21+
end
22+
end

2_Numbers/1_Types_of_numbers/task.md renamed to 2_Numbers/1_The_different_types_of_numbers/task.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ Read more about Complex here: (ruby-doc core: Complex).
7676

7777
---
7878

79-
Create some numbers of the different described types in the interactive Ruby console
80-
(`irb`) and press *v* to mark this unit green if you are done!
79+
Create a number of each described type and store it into a variable with the
80+
lowercased name of the number's class (e.g. *rational* for Rational).
81+
Create both types of Integers (*Fixnum* and *Bignum*)!
8182

8283
---

2_Numbers/1_Types_of_numbers/solution_spec.rb

Whitespace-only changes.

0 commit comments

Comments
 (0)