-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbasic_spec.rb
More file actions
39 lines (31 loc) · 833 Bytes
/
basic_spec.rb
File metadata and controls
39 lines (31 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require_relative 'spec_helper'
##
# Describe behaviour created in the JRuby Exception
# Class named Bar. This class include common basic
# things you can do with Classes as in JRuby Extensions
# mechanism.
##
describe Bar do
context "simple methods" do
it 'shout return a string' do
expect(subject.shout).to eq("Hello World!");
end
it 'say return a string' do
expect(subject.say).to eq("Hello World!");
end
end
context "arithmetic operations" do
it "add two numbers" do
expect(subject.add(3, 2)).to eq(5)
end
it "substract two numbers" do
expect(subject.subtract(3, 2)).to eq(1)
end
it "divide two numbers" do
expect(subject.divide(4, 2)).to eq(2)
end
it "multiply two numbers" do
expect(subject.multiply(4, 2)).to eq(8)
end
end
end