Skip to content

Commit d7198e1

Browse files
committed
Merge pull request #1 from makeitrealcamp/rama-1
slack = pilas
2 parents 2d3fad6 + 6b0b62c commit d7198e1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

stack_test.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require "./stack"
2+
require "minitest"
3+
require "minitest/autorun"
4+
5+
class TestStack < Minitest::Test
6+
def setup
7+
@stack = Stack.new
8+
end
9+
10+
def test_that_returns_nil_from_empty_stack
11+
assert_nil @stack.pop
12+
end
13+
14+
def test_that_can_push_and_pop_one_item
15+
@stack.push(1)
16+
assert_equal 1, @stack.pop
17+
end
18+
19+
def test_that_can_push_and_pop_multiple_items
20+
@stack.push(1)
21+
@stack.push(2)
22+
assert_equal 2, @stack.pop
23+
assert_equal 1, @stack.pop
24+
end
25+
26+
end

0 commit comments

Comments
 (0)