Skip to content

Commit

Permalink
Fix for RSpec 3 (which fails if pending passes)
Browse files Browse the repository at this point in the history
  • Loading branch information
searls committed Jan 14, 2016
1 parent e1d7c6c commit ec7d781
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions examples/integration/failing_messages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require 'open3'

describe "Failing Messages" do
skip_natural_assertions_if_not_supported

IOS = Struct.new(:out, :err)

def run_spec(filename)
Expand All @@ -18,12 +16,14 @@ def run_spec(filename)
When(:ios) { run_spec(failing_test) }

context "when referencing constants from nested modules" do
skip_natural_assertions_if_not_supported
Given(:failing_test) { "module_nesting_spec.rb" }
Then { ios.err == "" }
And { ios.out !~ /uninitialized constant RSpec::Given::InstanceExtensions::X/ }
end

context "when referencing undefined methods" do
skip_natural_assertions_if_not_supported
Given(:failing_test) { "undefined_method_spec.rb" }
Then { ios.err == "" }
And { complains_xyz_is_not_in_scope?(ios.out) }
Expand All @@ -39,6 +39,7 @@ def complains_xyz_is_not_in_scope?(out)
end

context "when breaking down expressions" do
skip_natural_assertions_if_not_supported
Given(:failing_test) { "eval_subexpression_spec.rb" }
Then { ios.err == "" }
And { ios.out =~ /false *<- array\[index\]\.upcase == value$/ }
Expand All @@ -55,6 +56,7 @@ def complains_xyz_is_not_in_scope?(out)
end

context "with an oddly formatted then" do
skip_natural_assertions_if_not_supported
Given(:failing_test) { "oddly_formatted_then.rb" }
Then { ios.out =~ /Failure\/Error:\s*Then \{ result == \['a',$/ }
And { ios.out =~ /expected: "anything"/ }
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/given/natural_assertion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

describe Given::NaturalAssertion do
describe "#content?" do
skip_natural_assertions_if_not_supported
context "with empty block" do
skip_natural_assertions_if_not_supported
FauxThen { }
Then { expect(na).to_not have_content }
end
Expand Down

0 comments on commit ec7d781

Please sign in to comment.