Skip to content

Commit

Permalink
Merge pull request #77 from davetron5000/rspec-3
Browse files Browse the repository at this point in the history
Rspec 3
  • Loading branch information
davetron5000 committed Jul 14, 2014
2 parents 9483eac + 8f0a13b commit be8faa7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
8 changes: 0 additions & 8 deletions features/rspec_2.99.0_version_test.feature

This file was deleted.

2 changes: 1 addition & 1 deletion lib/methadone/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module Cucumber

Then /^there should be a one line summary of what the app does$/ do
output_lines = all_output.split(/\n/)
output_lines.should have_at_least(3).items
output_lines.size.should >= 3
# [0] is our banner, which we've checked for
output_lines[1].should match(/^\s*$/)
output_lines[2].should match(/^\w+\s+\w+/)
Expand Down
3 changes: 1 addition & 2 deletions methadone.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |s|
s.add_development_dependency("simplecov", "~> 0.5")
s.add_development_dependency("clean_test")
s.add_development_dependency("mocha", "0.13.2")
s.add_development_dependency("minitest", "4.6.1")
s.add_development_dependency("sdoc")
s.add_development_dependency("rspec", "~> 2.99") # needed so that rspec-bootstrapped app test can run
s.add_development_dependency("rspec", "~> 3.0.0")
end
2 changes: 1 addition & 1 deletion templates/rspec/spec/something_spec.rb.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe "TestSomething" do
it "should be true" do
true.should be_true
true.should == true
end
end
4 changes: 4 additions & 0 deletions test/base_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
SimpleCov.start do
add_filter "/test"
end

require 'test/unit'
require 'rspec/expectations'
require 'clean_test/test_case'
require 'ostruct'

RSpec::Matchers.configuration.syntax = :should

class BaseTest < Clean::Test::TestCase
include RSpec::Matchers
end
10 changes: 5 additions & 5 deletions test/test_sh.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'base_test'
require 'methadone'

class TestSH < Clean::Test::TestCase
class TestSH < BaseTest
include Methadone::SH
include Methadone::CLILogging

Expand Down Expand Up @@ -143,7 +143,7 @@ def fatal(msg); @fatals << msg; end
use_capturing_logger
@command = test_command("foo")
@block_called = false
}
}
When {
@exit_code = sh @command do
@block_called = true
Expand All @@ -160,7 +160,7 @@ def fatal(msg); @fatals << msg; end
use_capturing_logger
@command = test_command("foo")
@block_called = false
}
}
When {
@exit_code = sh @command, :expected => [2] do
@block_called = true
Expand All @@ -180,7 +180,7 @@ def fatal(msg); @fatals << msg; end
@command = test_command("foo")
@block_called = false
@exitstatus_received = nil
}
}
When {
@exit_code = self.send(method,@command,:expected => expected) do |_,_,exitstatus|
@block_called = true
Expand Down Expand Up @@ -242,7 +242,7 @@ def fatal(msg); @fatals << msg; end
}
end

test_that "sh! runs a command that will fail and includes an error message that appears in the exception" do
test_that "sh! runs a command that will fail and includes an error message that appears in the exception" do
Given {
use_capturing_logger
@command = test_command("foo")
Expand Down

0 comments on commit be8faa7

Please sign in to comment.