Sha256: 54d594bf1092aaacf2cfbbc2b5b541d712be5057809cacf81565b0b1fb1a9c94

Contents?: true

Size: 1.13 KB

Versions: 57

Compression:

Stored size: 1.13 KB

Contents

require "spec_helper"

describe "error_on" do
  it "provides a description including the name of what the error is on" do
    have(1).error_on(:whatever).description.should == "have 1 error on :whatever"
  end

  it "provides a failure message including the number actually given" do
    lambda {
      [].should have(1).error_on(:whatever)
    }.should raise_error("expected 1 error on :whatever, got 0")
  end
end

describe "errors_on" do
  it "provides a description including the name of what the error is on" do
    have(2).errors_on(:whatever).description.should == "have 2 errors on :whatever"
  end

  it "provides a failure message including the number actually given" do
    lambda {
      [1].should have(3).errors_on(:whatever)
    }.should raise_error("expected 3 errors on :whatever, got 1")
  end
end

describe "have something other than error_on or errors_on" do
  it "has a standard rspec failure message" do
    lambda {
      [1,2,3].should have(2).elements
    }.should raise_error("expected 2 elements, got 3")
  end

  it "has a standard rspec description" do
    have(2).elements.description.should == "have 2 elements"
  end
end

Version data entries

57 entries across 52 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-rails-2.13.0/spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.14.1 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.99.0.beta1 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.14.0 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.13.1 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.13.0 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.12.2 spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.12.1 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.12.0 spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.11.4 spec/rspec/rails/matchers/errors_on_spec.rb
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/spec/rspec/rails/matchers/errors_on_spec.rb
rspec-rails-2.11.0 spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/spec/rspec/rails/matchers/errors_on_spec.rb