Sha256: b5e0bae252faef84a099a83d8253512285cb634a82073e742beddea8d7b507d0
Contents?: true
Size: 1.81 KB
Versions: 34
Compression:
Stored size: 1.81 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../../../test_helper') describe ::Inch::CLI::Command::Options::BaseList do it 'should run parse without errors' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--no-color']) assert_equal false, @options.show_all? assert_equal [:public, :protected], @options.visibility assert @options.namespaces.nil? assert @options.undocumented.nil? assert @options.depth.nil? end it 'should run parse twice without affecting the second run' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--no-public', '--no-protected', '--private']) assert_equal [:private], @options.visibility @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--no-color']) assert_equal [:public, :protected], @options.visibility end it 'should interpret --all options' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--all']) assert_equal true, @options.show_all? end it 'should interpret visibility options' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--no-public', '--no-protected', '--private']) assert_equal [:private], @options.visibility end it 'should interpret options' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--no-namespaces', '--no-undocumented', '--depth=2']) assert_equal :none, @options.namespaces assert_equal :none, @options.undocumented assert_equal 2, @options.depth end it 'should interpret other options' do @options = ::Inch::CLI::Command::Options::BaseList.new @options.parse(['--only-namespaces', '--only-undocumented']) assert_equal :only, @options.namespaces assert_equal :only, @options.undocumented end end
Version data entries
34 entries across 34 versions & 1 rubygems