File: spec_test.rb

package info (click to toggle)
ruby-knapsack 1.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,084 kB
  • sloc: ruby: 2,832; makefile: 4; sh: 3
file content (25 lines) | stat: -rw-r--r-- 304 bytes parent folder | download
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
require 'test_helper'

class FakeCalculator
  def add(x, y)
    x + y
  end

  def mal(x, y)
    x * y
  end
end

describe FakeCalculator do
  before do
    @calc = FakeCalculator.new
  end

  it '#add' do
    @calc.add(2, 3).must_equal 5
  end

  it '#mal' do
    @calc.mal(2, 3).must_equal 6
  end
end