diff --git a/Gemfile b/Gemfile index 3428381..1aa98e4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,2 @@ source "http://rubygems.org" -# Add dependencies required to use your gem here. -# Example: -# gem "activesupport", ">= 2.3.5" - -# Add dependencies to develop your gem here. -# Include everything needed to run rake, tests, features, etc. -group :development do - gem "jeweler", "~> 1.5.2" -end +gemspec diff --git a/Rakefile b/Rakefile index eb84b85..074b411 100644 --- a/Rakefile +++ b/Rakefile @@ -18,15 +18,10 @@ Jeweler::Tasks.new do |gem| gem.description = %Q{Give your application or gem an interactive shell, complete with custom prompts, tab completion, and various callbacks. Commands are defined as Ruby methods and can be grouped into logical subshells.} gem.email = "andy@rossmeissl.net" gem.authors = ["Andy Rossmeissl"] + gem.add_development_dependency 'aruba', '~> 0.3.2' end Jeweler::RubygemsDotOrgTasks.new -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "bombshell #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') -end +require 'cucumber/rake/task' +Cucumber::Rake::Task.new +task :default => :cucumber diff --git a/bombshell.gemspec b/bombshell.gemspec index a00cf40..f8cf409 100644 --- a/bombshell.gemspec +++ b/bombshell.gemspec @@ -51,11 +51,14 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_development_dependency(%q, ["~> 1.5.2"]) + s.add_development_dependency(%q, ["~> 0.3.2"]) else s.add_dependency(%q, ["~> 1.5.2"]) + s.add_dependency(%q, ["~> 0.3.2"]) end else s.add_dependency(%q, ["~> 1.5.2"]) + s.add_dependency(%q, ["~> 0.3.2"]) end end diff --git a/features/shell.feature b/features/shell.feature new file mode 100644 index 0000000..8906c7b --- /dev/null +++ b/features/shell.feature @@ -0,0 +1,23 @@ +Feature: Custom shell + + In order to allow my users to explore my library + As a Ruby library developer + I want to give them an interactive shell + + Scenario: Running the shell + Given a file named "fooshell.rb" with: + """ + require 'bombshell' + module Foo + class Shell < Bombshell::Environment + include Bombshell::Shell + end + end + Bombshell.launch Foo::Shell + """ + When I run "ruby fooshell.rb" interactively + And I type "quit" + Then the output should contain: + """ + [Bombshell] + """ diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 0000000..705ec10 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,10 @@ +$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') +require 'aruba/cucumber' +require 'fileutils' +require 'rspec/expectations' +require 'bombshell' + +Before do + @aruba_io_wait_seconds = 1 + @dirs = [File.join(ENV['HOME'], 'bombshell_features')] +end diff --git a/spec/bombshell_spec.rb b/spec/bombshell_spec.rb deleted file mode 100644 index 011cb29..0000000 --- a/spec/bombshell_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/spec_helper') - -describe "Bombshell" do - it "fails" do - fail "hey buddy, you should probably rename this file and start specing for real" - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 2e0052e..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,12 +0,0 @@ -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$LOAD_PATH.unshift(File.dirname(__FILE__)) -require 'rspec' -require 'bombshell' - -# Requires supporting files with custom matchers and macros, etc, -# in ./support/ and its subdirectories. -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} - -RSpec.configure do |config| - -end