Sha256: 3074026549ec68c7a57f379e6650ab2c3378dca9d4a6fd781e462d5d9aecb2df
Contents?: true
Size: 1.6 KB
Versions: 2
Compression:
Stored size: 1.6 KB
Contents
#-- # wwwjdic # Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani # # This file is part of wwwjdic. # # wwwjdic is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # wwwjdic is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with wwwjdic. If not, see <http://www.gnu.org/licenses/>. #++ require_relative '../../test_helper' describe WWWJDic::WWWJDic do describe 'when using a parser' do include WWWJDic::ParsableDuckType before do @parser = subject I18n.load_path = Dir[File.join(File.dirname(__FILE__), '/../../../lib/wwwjdic/locales/', '*.yml')] end subject {WWWJDic::Parsers::Display.new} describe 'when a valid display mode is selected' do WWWJDic::DISPLAY.each do |key, value| it "shall return '#{value}' when parameter is '#{key}'" do subject.parse(key).must_equal key WWWJDic::DISPLAY[subject.parse(key)].must_equal value end end end describe 'when an invalid display mode is selected' do it 'shall raise an error' do assert_raises ArgumentError do subject.parse :xx end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wwwjdic-13.0.1 | test/wwwjdic/parsers/test_display.rb |
wwwjdic-13.0.0 | test/wwwjdic/parsers/test_display.rb |