Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #5 from berlin-ab/also

Cleaned up my branch for Also.
  • Loading branch information...
commit d1a61a422a398613f507a6b6c09051fdc0982b35 2 parents 5208cd5 + 45b12f6
@robb1e authored
Showing with 11 additions and 6 deletions.
  1. +8 −0 Rakefile
  2. +1 −3 lib/simple_bdd.rb
  3. +2 −3 spec/simple_bdd_spec.rb
View
8 Rakefile
@@ -1 +1,9 @@
+task :bundle_install do
+ system("bundle")
+end
+
require "bundler/gem_tasks"
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
+
+task :default => [:bundle_install, :spec]
View
4 lib/simple_bdd.rb
@@ -1,13 +1,11 @@
require "simple_bdd/version"
module SimpleBdd
-
- %w[Given When Then And].each do |method|
+ %w[Given When Then And Also].each do |method|
define_method(method) do |message|
send message.downcase.gsub(" ", "_").gsub(/\W/, "")
end
alias_method method.downcase, method
end
-
end
View
5 spec/simple_bdd_spec.rb
@@ -5,11 +5,10 @@ class SimpleBddExample
end
describe SimpleBddExample do
-
let(:subject) { SimpleBddExample.new }
- describe "#given, #when, #then, #and" do
- ["given", "when", "then", "and", "Given", "When", "Then", "And"].each do |method|
+ describe "#given, #when, #then, #and, #also" do
+ ["given", "when", "then", "and", "Given", "When", "Then", "And", "Also", "also"].each do |method|
it "calls the method after translating the string" do
subject.should_receive(:something_something_darkside)
subject.send(method, "Something, Something Darkside")
Please sign in to comment.
Something went wrong with that request. Please try again.