diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..ec0c01a --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +group :development do + gem 'pry' + gem 'rspec' +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..29f95d8 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,30 @@ +GEM + remote: https://rubygems.org/ + specs: + coderay (1.1.0) + diff-lcs (1.2.5) + method_source (0.8.2) + pry (0.9.12.6) + coderay (~> 1.0) + method_source (~> 0.8) + slop (~> 3.4) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-core (3.0.2) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.2) + rspec-support (~> 3.0.0) + rspec-support (3.0.2) + slop (3.5.0) + +PLATFORMS + ruby + +DEPENDENCIES + pry + rspec diff --git a/README.md b/README.md index a7313e0..3fc7329 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -Betty (version 0.1.6) +Betty (version 0.1.7) ===================== +![circle ci build](https://circleci.com/gh/pickhardt/betty/tree/dev.png) Betty is a friendly English-like interface for your command line. @@ -158,6 +159,10 @@ Contributing Contributions are welcome! If you would like to contribute, please issue a pull request against the **dev branch**, not the master branch. +Please ensure that you use soft tabs, converting tabs to spaces. Do not use actual tab characters because it will make the spacing look weird in others' text editors. + +Please make sure that the tests pass and try to write tests for your contributions. To check the tests, first run `bundle install` followed by `bundle exec rspec spec` + Versioning ---------- diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..70a846d --- /dev/null +++ b/Rakefile @@ -0,0 +1,5 @@ +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec diff --git a/changelog.txt b/changelog.txt index 28a418b..1b38e0b 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,13 @@ +0.1.7 (September 21, 2014) +-------------------------- + +Added rock, paper, scissors. + +Added some tests. + +Fixed a bug with the copy and move commands. + + 0.1.6 (May 26, 2014) -------------------- diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..abd671b --- /dev/null +++ b/circle.yml @@ -0,0 +1,6 @@ +dependencies: + pre: + - bundle install +test: + override: + - bundle exec rspec spec \ No newline at end of file diff --git a/lib/calc.rb b/lib/calc.rb index 3c44cd7..4a38d2e 100755 --- a/lib/calc.rb +++ b/lib/calc.rb @@ -7,16 +7,97 @@ def numeric? module Calculate def self.interpret(command) responses = [] + + + matches = command.match(/^what\s+is\s+(?:the\s+)?(?:square\s+root|sqrt)\s+of\s+(.+)$/) + if matches + + if matches[1].numeric? + arg1 = matches[1] + else + return [] + end + + responses << { + command: "echo 'scale=10;sqrt(#{arg1})' | bc", + explanation: "Calculates square root of #{arg1}" + } + return responses + end + + + matches = command.match(/^what\s+is\s+(?:the\s+)?(square|cube)\s+of\s+(.+)$/) + if matches + + power_text = matches[1] + if power_text == 'square' + power = 2 + elsif power_text == 'cube' + power = 3 + else + return [] + end + + if matches[2].numeric? + arg1 = matches[2] + else + return [] + end + + responses << { + command: "echo '#{arg1}^#{power}' | bc", + explanation: "Calculates #{power_text} of #{arg1}" + } + return responses + end + + + matches = command.match(/^what\s+is\s+(.+)\s+(to\s+the|to\s+the\s+power\s+of|power)\s+(.+)$/) + if matches + + if ( matches[1].gsub(/(\s+|to|the|of)/,"").numeric? && matches[3].gsub(/(\s+|to|the|of)/,"").numeric?) + arg1 = matches[1].gsub(/(\s+|to|the|of)/,"") + arg3 = matches[3].gsub(/(\s+|to|the|of)/,"") + else + return [] + end + + responses << { + command: "echo '#{arg1}^#{arg3}' | bc", + explanation: "Calculates #{arg1} to the power of #{arg3}" + } + return responses + end + + + matches = command.match(/^what\s+is\s+(?:the\s+)?(.+)\s?(?:%|percent)\s+of\s+(.+)$/) + if matches + + if ( matches[1].numeric? && matches[2].numeric? ) + arg1 = matches[1].strip + arg2 = matches[2].strip + else + return [] + end + + responses << { + command: "echo 'scale=2;#{arg1}*#{arg2}/100' | bc", + explanation: "Calculates #{arg1} percent of #{arg2}" + } + return responses + end + + matches = command.match(/^what\s+is\s+(.+)\s+(.+)\s(.+)$/) - if matches + if (matches[1].numeric? && matches[3].numeric?) arg1 = matches[1] arg2 = matches[3] else return [] end - + oper = matches[2] if ["plus", "+"].include?(oper) op = "+" @@ -26,15 +107,18 @@ def self.interpret(command) op = "*" elsif ["by", "divided", "divied by", "/"].include?(oper) op = "/" + elsif ["mod", "module", "%"].include?(oper) + op = "%" else return [] end responses << { - command: "bc <<< #{arg1}#{op}#{arg2}", + command: "echo '#{arg1}#{op}#{arg2}' | bc", explanation: "Calculates #{arg1}#{op}#{arg2}" } end + responses end @@ -43,7 +127,12 @@ def self.help commands << { category: "Calculate", description: '\033[34mCalculate\033[0m', - usage: ["- betty what is 40 plus 2"] + usage: ["what is 40 plus 2", + "what is the square root of 9", + "what is the cube of 3", + "what is 3 to the power of 4", + "what is the 11 percent of 200", + "what is 26 mod 5"] } commands end diff --git a/lib/files.rb b/lib/files.rb index a2043bf..f3e8ed5 100644 --- a/lib/files.rb +++ b/lib/files.rb @@ -1,144 +1,139 @@ module Files - def self.interpret(command) - responses = [] - - ## Create file - if command.match(/create\s+([new\s]?)+file(s?)/i) - files = command.sub(/create\s+([new\s]?)+file(s?)/i,'').strip.split(' ') - responses <<{ - :command => "touch #{files.join(' ')}", - :explanation => "Create file(s)." - } - end - - ## Create Folder - if command.match(/(create|make)\s+([new\s]?)+(folder(s?)|dir|director(y|ies))(s?)\s/i) - files = command.sub(/(create|make)\s+([new\s]?)+(folder(s?)|dir|director(y|ies))(s?)\s/i,'').strip.split(' ') - responses << { - :command => "mkdir #{files.join(' ')}", - :explanation => "Create Folder(s)" - } - end - - ## Rename file/folder - if command.match(/rename\s+(file|folder)\s/i) - paths = command.sub(/rename\s+(file|folder)\s/,'').strip.split(' ') - - if !(paths.size<2 || paths.size > 3) - paths -= ["to"] if(paths.size==3) - old_f, new_f = paths - - responses << { - :command => "mv #{old_f} #{new_f}", - :explanation => "Rename file/folder" - } - end - end - - ## Delete file(s) - if command.match(/(delete|remove)\s+file(s?)\s/) - paths = command.sub(/(delete|remove)\s+file\s/,'').strip.split(' ') - - responses << { - :command => "rm #{paths.join(' ')}", - :explanation => "Remove file(s)" - } - end - - ## Delete folder(s) - if command.match(/(delete|remove)\s+folder(s?)\s/) || - command.match(/(delete|remove)\s+all\s+(file(s?))\s+in\s/) - paths = command.sub(/(delete|remove)\s+folder(s?)\s/,'').strip.split(' ') - - responses << { - :command => "rm -r #{paths.join(' ')}", - :explanation => "Remove folder(s)" - } + def self.interpret(command) + responses = [] + + ## Create file + if command.match(/create\s+([new\s]?)+file(s?)/i) + files = command.sub(/create\s+([new\s]?)+file(s?)/i,'').strip.split(' ') + responses <<{ + :command => "touch #{files.join(' ')}", + :explanation => "Create file(s)." + } + end + + ## Create Folder + if command.match(/(create|make)\s+([new\s]?)+(folder(s?)|dir|director(y|ies))(s?)\s/i) + files = command.sub(/(create|make)\s+([new\s]?)+(folder(s?)|dir|director(y|ies))(s?)\s/i,'').strip.split(' ') + responses << { + :command => "mkdir #{files.join(' ')}", + :explanation => "Create Folder(s)" + } end - ## Delete files and folders - if command.match(/cleanup\s+folder(s?)\s/) || command.match(/force\s+cleanup\s+folder(s?)\s/) - paths = command.sub(/cleanup\s+folder(s?)\s/,'').strip.split(' ') - flags = "-r " - flags += command.match(/force/) ? '-f ' : '' - - responses << { - :command => "rm #{flags} #{paths.join(' ')}", - :explanation => "Removes all files and folders in give folder" - } + ## Rename file/folder + if command.match(/rename\s+(file|folder)\s/i) + paths = command.sub(/rename\s+(file|folder)\s/,'').strip.split(' ') + + if !(paths.size<2 || paths.size > 3) + paths -= ["to"] if(paths.size==3) + old_f, new_f = paths + + responses << { + :command => "mv #{old_f} #{new_f}", + :explanation => "Rename file/folder" + } end - - ## Copy, Move, Scp files/folders - if action = command.match(/(copy|move)\s+(file(s?)|folder(s?))\s+(from?)\s/i) - - paths = command.sub(/(copy|move)\s+(file(s?)|folder(s?))\s+(from?)\s/i,'').strip.split(' ') - if !(paths.size > 3 || paths.size <2) - paths -= ['to'] if(paths.size == 3) # Remove 'to' if exist - - source, destination = paths - - ## Remote transfer ## !!!! SUGGESTION REQUIRED !!!! - if (source.split('@')[1].split(':')[0].match(/(.com|\d+)/) rescue false)|| (destination.split('@')[1].split(':')[0].match(/(.com|\d+)/) rescue false) - flags = "" - flags += (File.directory?(source) || File.directory?(destination)) ? "-r " : '' - - responses << { - :command => "scp #{flags} #{source} #{destination}", - :explanation => "Remote Transfer" - } - elsif File.exist?(source) - ## Move - if action[1] == 'move' - responses << { - :command => "mv #{source} #{destination}", - :explanation => "Move the file/folder" - } - ## Copy - elsif action[1] == 'copy' - flags = "" - flags += File.directory?(source) ? "-R" : '' - responses << { - :command => "cp #{flags} #{source} #{destination}", - :explanation => "Move the file/folder" - } - end - end - - end # path - - end - - responses - end - - def self.help - commands = [] - commands << { - :category => "Files", - :usage =>[ "- betty create file fop.txt", - "- betty create new file foo.txt", - "- betty create files foo.txt bar.txt", - "- betty create new files foo.txt bar.txt", - "- betty create folder foo", - "- betty create folders foo bar", - "- betty create directory foo", - "- betty create directories foo bar", - "- betty create new folder foo", - "- betty make directory foo", - "- betty make directories foo bar", - "- betty copy file my.txt to usr/", - "- betty move file my.txt to usr/", - "- betty copy folder my_songs/ to backup/", - "- betty move folder my_songs/ to backup/", - "- betty delete file junk.txt", - "- betty remove file junk.txt", - "- betty delete folder logs/", - "- betty remove folder logs/", - "- betty cleanup folder logs/", - "- betty force cleanup folder logs/" - ] - } - end + end + + ## Delete file(s) + if command.match(/(delete|remove)\s+file(s?)\s/) + paths = command.sub(/(delete|remove)\s+file\s/,'').strip.split(' ') + + responses << { + :command => "rm #{paths.join(' ')}", + :explanation => "Remove file(s)" + } + end + + ## Delete folder(s) + if command.match(/(delete|remove)\s+folder(s?)\s/) || + command.match(/(delete|remove)\s+all\s+(file(s?))\s+in\s/) + paths = command.sub(/(delete|remove)\s+folder(s?)\s/,'').strip.split(' ') + + responses << { + :command => "rm -r #{paths.join(' ')}", + :explanation => "Remove folder(s)" + } + end + + ## Delete files and folders + if command.match(/cleanup\s+folder(s?)\s/) || command.match(/force\s+cleanup\s+folder(s?)\s/) + paths = command.sub(/cleanup\s+folder(s?)\s/,'').strip.split(' ') + flags = "-r " + flags += command.match(/force/) ? '-f ' : '' + + responses << { + :command => "rm #{flags} #{paths.join(' ')}", + :explanation => "Removes all files and folders in give folder" + } + end + + ## Copy, Move, Scp files/folders + if action = command.match(/(copy|move)\s+(file(s?)|folder(s?)\s+)?(from\s+)?/i) + paths = command.sub(/(copy|move)\s+(file(s?)|folder(s?)\s+)?(from\s+)?/i, '').strip.split(' ') + if !(paths.size > 3 || paths.size < 2) + paths -= ['to'] if paths.size == 3 # Remove 'to' if exist + + source, destination = paths + + ## Remote transfer ## !!!! SUGGESTION REQUIRED !!!! + if (source.split('@')[1].split(':')[0].match(/(.com|\d+)/) rescue false)|| (destination.split('@')[1].split(':')[0].match(/(.com|\d+)/) rescue false) + flags = "" + flags += (File.directory?(source) || File.directory?(destination)) ? "-r " : '' + + responses << { + :command => "scp #{flags}#{source} #{destination}", + :explanation => "Remote transfer" + } + else + if action[1].downcase == 'move' + responses << { + :command => "mv #{source} #{destination}", + :explanation => "Moves the file/folder" + } + elsif action[1].downcase == 'copy' + flags = "" + flags += File.directory?(source) ? "-R " : '' + responses << { + :command => "cp #{flags}#{source} #{destination}", + :explanation => "Copies the file/folder" + } + end + end + end # path + end + + responses + end + + def self.help + commands = [] + commands << { + :category => "Files", + :usage =>[ "- betty create file fop.txt", + "- betty create new file foo.txt", + "- betty create files foo.txt bar.txt", + "- betty create new files foo.txt bar.txt", + "- betty create folder foo", + "- betty create folders foo bar", + "- betty create directory foo", + "- betty create directories foo bar", + "- betty create new folder foo", + "- betty make directory foo", + "- betty make directories foo bar", + "- betty copy file my.txt to usr/", + "- betty move file my.txt to usr/", + "- betty copy folder my_songs/ to backup/", + "- betty move folder my_songs/ to backup/", + "- betty delete file junk.txt", + "- betty remove file junk.txt", + "- betty delete folder logs/", + "- betty remove folder logs/", + "- betty cleanup folder logs/", + "- betty force cleanup folder logs/" + ] + } + end end $executors << Files \ No newline at end of file diff --git a/lib/os.rb b/lib/os.rb index 149c4a7..dfb2439 100644 --- a/lib/os.rb +++ b/lib/os.rb @@ -32,6 +32,15 @@ def self.interpret(command) :explanation => "Show what OS is used." } end + + if command.match(/^(?:show|me|whats|what|is|my|\s)*kernel(?:\s|name|do i have|is used|.)*$/i) + os = platform_name + + responses << { + :command => "uname -a", + :explanation => "Show what OS is used." + } + end responses end diff --git a/lib/rock_paper_scissors.rb b/lib/rock_paper_scissors.rb new file mode 100644 index 0000000..22ea92f --- /dev/null +++ b/lib/rock_paper_scissors.rb @@ -0,0 +1,43 @@ +module RockPaperScissors + def self.interpret(command) + responses = [] + + possible_moves = ['rock', 'paper', 'scissors'] + + if command.match(/^(rock|paper|scissors)$/) + user_hand = $1 + betty_hand = possible_moves.fetch(rand(3)) + + if user_hand == betty_hand + result = "Tie" + elsif (user_hand == 'rock' && betty_hand == 'scissors' ) || + (user_hand == 'paper' && betty_hand == 'rock') || + (user_hand == 'scissors' && betty_hand == 'paper' ) + result = "You won" + elsif (user_hand == 'scissors' && betty_hand == 'rock') || + (user_hand == 'rock' && betty_hand == 'paper') || + (user_hand == 'paper' && betty_hand == 'scissors') + result = "Betty won" + end + + responses << { + :say => "You got: \e[0;94;49m#{user_hand}\e[0m and Betty got: \e[0;94;49m#{betty_hand}\e[0m ....... #{result}", + :explanation => "Play rock, paper, scissors with betty" + } + end + + responses + end + + def self.help + commands = [] + commands << { + :category => "RockPaperScissors", + :description => 'Play rock, paper, scissors with betty', + :usage => ["rock", "paper", "scissors"] + } + commands + end +end + +$executors << RockPaperScissors diff --git a/lib/user.rb b/lib/user.rb index b75945c..c6eb9b1 100755 --- a/lib/user.rb +++ b/lib/user.rb @@ -47,7 +47,7 @@ def self.interpret(command) end - if command.match(/^what\'?s?(?:\s+is)?(?:\s+(?:the|my))?\s+version(?:\s+of)?(\s[a-zA-Z\-_]+)?\??$/i) + if command.match(/^what\'?s?(?:\s+is)?(?:\s+(?:the|my))?\s+version(?:\s+of)?(\s[a-zA-Z\-_]+)+\??$/i) program = $1.strip command_to_use = "" @@ -56,6 +56,8 @@ def self.interpret(command) command_to_use = "go version" when "mysql" command_to_use = "mysql -u root -p -e ' SELECT VERSION(); '" + when "openssl" + command_to_use = "openssl version" else command_to_use = "#{ program } --version" end diff --git a/main.rb b/main.rb index e49448d..bc45561 100755 --- a/main.rb +++ b/main.rb @@ -2,7 +2,7 @@ require 'logger' $URL = 'https://github.com/pickhardt/betty' -$VERSION = '0.1.6' +$VERSION = '0.1.7' $executors = [] $LOG = Logger.new(File.open(ENV['HOME'] + '/.betty_history', 'a+')) diff --git a/spec/calc_spec.rb b/spec/calc_spec.rb new file mode 100644 index 0000000..2501574 --- /dev/null +++ b/spec/calc_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe 'Calculate' do + context 'what is the square root of 9' do + it { responds_with :command => "echo 'scale=10;sqrt(9)' | bc", :explanation => "Calculates square root of 9" } + end + + context 'what is the square of 3' do + it { responds_with :command => "echo '3^2' | bc", :explanation => "Calculates square of 3" } + end + + context 'what is 3 to the power of 4' do + it { responds_with :command => "echo '3^4' | bc", :explanation => "Calculates 3 to the power of 4" } + end + + context 'what is the 11 percent of 200' do + it { responds_with :command => "echo 'scale=2;11*200/100' | bc", :explanation => "Calculates 11 percent of 200" } + end + + context 'what is 3 plus 5' do + it { responds_with :command => "echo '3+5' | bc", :explanation => "Calculates 3+5" } + end + + context 'what is 16 mod 5' do + it { responds_with :command => "echo '16%5' | bc", :explanation => "Calculates 16%5" } + end +end diff --git a/spec/files_spec.rb b/spec/files_spec.rb new file mode 100644 index 0000000..77c8952 --- /dev/null +++ b/spec/files_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe 'Files' do + context 'Copy myfile.txt to mycopy.txt' do + it { responds_with command: "cp myfile.txt mycopy.txt", + explanation: "Copies the file/folder" } + end + + context 'copy folder mysongs/ to backup/' do + it { responds_with command: "cp mysongs/ backup/", + explanation: "Copies the file/folder" } + end +end diff --git a/spec/fun_spec.rb b/spec/fun_spec.rb new file mode 100644 index 0000000..4ef29a9 --- /dev/null +++ b/spec/fun_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe 'Fun' do + + context 'What is the meaning of life?' do + it { responds_with say: "42." } + end + + context 'Open the pod bay doors' do + it { responds_with say: "I'm sorry, Dave. I'm afraid I can't do that." } + end + + context 'sudo make me a sandwich' do + it { responds_with say: "I think you meant to place sudo at the start of the command." } + end + +end diff --git a/spec/os_module_spec.rb b/spec/os_module_spec.rb new file mode 100644 index 0000000..0b93353 --- /dev/null +++ b/spec/os_module_spec.rb @@ -0,0 +1,42 @@ +require 'spec_helper' + +describe 'OS' do + + context "platform name" do + before(:all) do + $VERBOSE = nil + @platform = RUBY_PLATFORM + RUBY_PLATFORM = 'darwin' + end + + after(:all) do + RUBY_PLATFORM = @platform + end + + context "OS" do + it "should return right OS name on interpret method" do + responds_with( + command: "echo 'OS X'", + explanation: "Show what OS is used." + ) + end + end + + it "returns the right OS name on platform_name method" do + result = OS.platform_name + expect(result).to eq("OS X") + end + end + + context "help" do + subject { OS.help } + + it "should return right help" do + responds_with( + category: "OS", + description: 'Show \033[34mOS\033[0m name', + usage: ["show what OS is used"] + ) + end + end +end diff --git a/spec/rock_paper_scissors_spec.rb b/spec/rock_paper_scissors_spec.rb new file mode 100644 index 0000000..fb87f98 --- /dev/null +++ b/spec/rock_paper_scissors_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe 'RockPaperScissors' do + + context 'rock' do + it { should + include(:explanation => "Play rock, paper, scissors with betty") + } + end + +end diff --git a/test/spec/spec_helper.rb b/spec/spec_helper.rb similarity index 67% rename from test/spec/spec_helper.rb rename to spec/spec_helper.rb index dbc4f1a..0af4ced 100644 --- a/test/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,10 +4,17 @@ # loaded once. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration + +require_relative '../main.rb' + RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true - config.run_all_when_everything_filtered = true - config.filter_run :focus + + # Default our subject to run betty with the context + config.before(:all) do + self.class.subject do + interpret(self.class.description) + end + end # Run specs in random order to surface order dependencies. If you find an # order dependency and want to debug it, you can fix the order by providing @@ -15,3 +22,9 @@ # --seed 1234 config.order = 'random' end + +# Some custom test vocabulary +# +def responds_with(something) + should(include(something)) +end diff --git a/spec/user_spec.rb b/spec/user_spec.rb new file mode 100644 index 0000000..c6f5b18 --- /dev/null +++ b/spec/user_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe 'User' do + + context 'what version' do + it { responds_with :say => $VERSION, :explanation => "Gets Betty's version."} + end + context 'what version is openssl' do + it { responds_with :command => "openssl version", :explanation => "Gets the version of openssl."} + end + +end \ No newline at end of file diff --git a/test/.rspec b/test/.rspec deleted file mode 100644 index 5f16476..0000000 --- a/test/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---format progress diff --git a/test/spec/os_module_test.rb b/test/spec/os_module_test.rb deleted file mode 100644 index 0d05bb0..0000000 --- a/test/spec/os_module_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -require "rspec" -require_relative "../../main" -require_relative "../../lib/os" - -describe 'OS' do - - context "platform name" do - before(:all) do - $VERBOSE = nil - @platform = RUBY_PLATFORM - RUBY_PLATFORM = 'darwin' - end - - after(:all) do - RUBY_PLATFORM = @platform - end - - it "should return right OS name on interpret method" do - - result = OS.interpret "OS" - result[0][:command].should eq("echo 'OS X'") - result[0][:explanation].should eq("Show what OS is used.") - - end - - it "should return right OS name on platform_name method" do - - result = OS.platform_name - result.should eq("OS X") - - end - end - - context "help" do - it "should return right help" do - - result = OS.help - result[0][:category].should eq("OS") - result[0][:description].should eq('Show \033[34mOS\033[0m name') - result[0][:usage].should eq(["show what OS is used"]) - - end - end - end diff --git a/test/test.rb b/test/test.rb deleted file mode 100755 index 4b7979d..0000000 --- a/test/test.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe Betty do - -end