Sha256: c8649d0989a1c4136519b3098ee90832669a7ba17ac0f3683bd589473f82b3e6

Contents?: true

Size: 1.26 KB

Versions: 60

Compression:

Stored size: 1.26 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

describe "should include(expected)" do
  it "should pass if target includes expected" do
    [1,2,3].should include(3)
    "abc".should include("a")
  end

  it "should fail if target does not include expected" do
    lambda {
      [1,2,3].should include(4)
    }.should fail_with("expected [1, 2, 3] to include 4")
    lambda {
      "abc".should include("d")
    }.should fail_with("expected \"abc\" to include \"d\"")
  end
end

describe "should include(with, multiple, args)" do
  it "should pass if target includes all items" do
    [1,2,3].should include(1,2,3)
  end

  it "should fail if target does not include any one of the items" do
    lambda {
      [1,2,3].should include(1,2,4)
    }.should fail_with("expected [1, 2, 3] to include 1, 2 and 4")
  end
end

describe "should_not include(expected)" do
  it "should pass if target does not include expected" do
    [1,2,3].should_not include(4)
    "abc".should_not include("d")
  end

  it "should fail if target includes expected" do
    lambda {
      [1,2,3].should_not include(3)
    }.should fail_with("expected [1, 2, 3] not to include 3")
    lambda {
      "abc".should_not include("c")
    }.should fail_with("expected \"abc\" not to include \"c\"")
  end
end

Version data entries

60 entries across 60 versions & 9 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.6 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.7 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
picolena-0.1.8 rails_plugins/rspec/spec/spec/matchers/include_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/matchers/include_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/matchers/include_spec.rb