RSpec Code Examples

 

 

pending spec with no implementation
is pending (PENDING: Not Yet Implemented)
pending command with block format
with content that would fail
is pending (PENDING: No reason given)
with content that would pass
fails
RSpec::Core::PendingExampleFixedError
./spec/rspec/core/resources/formatter_specs.rb:19
./spec/spec_helper.rb:31:in `run'
./spec/spec_helper.rb:31:in `run'
./spec/rspec/core/formatters/html_formatter_spec.rb:24
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
./spec/rspec/core/formatters/html_formatter_spec.rb:45
./spec/spec_helper.rb:82
./spec/spec_helper.rb:54:in `instance_eval'
./spec/spec_helper.rb:54:in `sandboxed'
./spec/spec_helper.rb:82
:1
11          rescue Exception => e
12          end
13          raise RSpec::Core::PendingExampleFixedError.new if result
14        end
15        throw :pending_declared_in_example, message
passing spec
passes
failing spec
fails
expected 2
     got 1

(compared using ==)
./spec/rspec/core/resources/formatter_specs.rb:34
./spec/spec_helper.rb:31:in `run'
./spec/rspec/core/formatters/html_formatter_spec.rb:24
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:46:in `open'
./spec/rspec/core/formatters/html_formatter_spec.rb:46
./spec/rspec/core/formatters/html_formatter_spec.rb:45:in `chdir'
./spec/rspec/core/formatters/html_formatter_spec.rb:45
./spec/spec_helper.rb:82
./spec/spec_helper.rb:54:in `instance_eval'
./spec/spec_helper.rb:54:in `sandboxed'
./spec/spec_helper.rb:82
:1
27        end
28
29        raise(RSpec::Expectations::ExpectationNotMetError.new(message))
30      end