Sha256: a9856301635d49b0b5af157497ea8947d87c5de3c43e736d6eff4f7db3277885

Contents?: true

Size: 888 Bytes

Versions: 33

Compression:

Stored size: 888 Bytes

Contents

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

describe "error_on" do
  it "should provide a description including the name of what the error is on" do
    have(1).error_on(:whatever).description.should == "should have 1 error on :whatever"
  end
  
  it "should provide a failure message including the number actually given" do
    lambda {
      [].should have(1).error_on(:whatever)
    }.should fail_with("expected 1 error on :whatever, got 0")
  end
end

describe "errors_on" do
  it "should provide a description including the name of what the error is on" do
    have(2).errors_on(:whatever).description.should == "should have 2 errors on :whatever"
  end
  
  it "should provide a failure message including the number actually given" do
    lambda {
      [1].should have(3).errors_on(:whatever)
    }.should fail_with("expected 3 errors on :whatever, got 1")
  end
end

Version data entries

33 entries across 33 versions & 5 rubygems

Version Path
cavalle-rspec-rails-1.2.2.0.1 spec/spec/rails/matchers/errors_on_spec.rb
cavalle-rspec-rails-1.2.2.0.2 spec/spec/rails/matchers/errors_on_spec.rb
cavalle-rspec-rails-1.2.3.1 spec/spec/rails/matchers/errors_on_spec.rb
cavalle-rspec-rails-1.2.4.0.1 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.11.4 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.11.5 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.11.6 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.11.7 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.12 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.1 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.13 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.2 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.3 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.4 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.5 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.6 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.7 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.8 spec/spec/rails/matchers/errors_on_spec.rb
dchelimsky-rspec-rails-1.1.99.9 spec/spec/rails/matchers/errors_on_spec.rb
mcmire-rspec-rails-1.1.99.9 spec/spec/rails/matchers/errors_on_spec.rb