Permalink
Browse files

Remove the rspec-1 example specs

  • Loading branch information...
dchelimsky committed Jun 2, 2010
1 parent a897e61 commit 9aa73b520ce1ead579b238b46a0eb87a7559de77
Showing with 0 additions and 1,386 deletions.
  1. +0 −7 example_specs/failing/README.txt
  2. +0 −38 example_specs/failing/diffing_spec.rb
  3. +0 −19 example_specs/failing/failing_implicit_docstrings_example.rb
  4. +0 −10 example_specs/failing/failure_in_after.rb
  5. +0 −10 example_specs/failing/failure_in_before.rb
  6. +0 −40 example_specs/failing/mocking_example.rb
  7. +0 −26 example_specs/failing/mocking_with_flexmock.rb
  8. +0 −25 example_specs/failing/mocking_with_mocha.rb
  9. +0 −27 example_specs/failing/mocking_with_rr.rb
  10. +0 −20 example_specs/failing/partial_mock_example.rb
  11. +0 −9 example_specs/failing/pending_example.rb
  12. +0 −34 example_specs/failing/predicate_example.rb
  13. +0 −47 example_specs/failing/raising_example.rb
  14. +0 −1 example_specs/failing/spec_helper.rb
  15. +0 −7 example_specs/failing/syntax_error_example.rb
  16. +0 −43 example_specs/failing/team_spec.rb
  17. +0 −7 example_specs/failing/timeout_behaviour.rb
  18. +0 −12 example_specs/passing/custom_formatter.rb
  19. +0 −54 example_specs/passing/custom_matchers.rb
  20. +0 −9 example_specs/passing/dynamic_spec.rb
  21. +0 −19 example_specs/passing/file_accessor.rb
  22. +0 −38 example_specs/passing/file_accessor_spec.rb
  23. +0 −18 example_specs/passing/filtered_formatter.rb
  24. +0 −31 example_specs/passing/filtered_formatter_example.rb
  25. +0 −31 example_specs/passing/greeter_spec.rb
  26. +0 −14 example_specs/passing/helper_method_example.rb
  27. +0 −18 example_specs/passing/implicit_docstrings_example.rb
  28. +0 −8 example_specs/passing/io_processor.rb
  29. +0 −21 example_specs/passing/io_processor_spec.rb
  30. +0 −27 example_specs/passing/mocking_example.rb
  31. +0 −26 example_specs/passing/multi_threaded_example_group_runner.rb
  32. +0 −36 example_specs/passing/nested_classes_example.rb
  33. +0 −31 example_specs/passing/options_example.rb
  34. +0 −20 example_specs/passing/options_formatter.rb
  35. +0 −29 example_specs/passing/partial_mock_example.rb
  36. +0 −20 example_specs/passing/pending_example.rb
  37. +0 −27 example_specs/passing/predicate_example.rb
  38. +0 −81 example_specs/passing/shared_example_group_example.rb
  39. +0 −36 example_specs/passing/shared_stack_examples.rb
  40. +0 −1 example_specs/passing/spec_helper.rb
  41. +0 −36 example_specs/passing/stack.rb
  42. +0 −64 example_specs/passing/stack_spec.rb
  43. +0 −67 example_specs/passing/stack_spec_with_nested_example_groups.rb
  44. +0 −69 example_specs/passing/stubbing_example.rb
  45. +0 −45 example_specs/passing/subject_example.rb
  46. +0 −33 example_specs/passing/yielding_example.rb
  47. +0 −85 example_specs/ruby1.9.compatibility/access_to_constants_spec.rb
  48. +0 −10 example_specs/spec_helper.rb
@@ -1,7 +0,0 @@
-"Why have failing examples?", you might ask.
-
-They allow us to see failure messages. RSpec wants to provide meaningful and helpful failure messages. The failures in this directory not only provide you a way of seeing the failure messages, but they provide RSpec's own specs a way of describing what they should look like and ensuring they stay correct.
-
-To see the types of messages you can expect, stand in this directory and run:
-
-../bin/rspec ./*.rb
@@ -1,38 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe "Running specs with --diff" do
- it "should print diff of different strings" do
- uk = <<-EOF
-RSpec is a
-behaviour driven development
-framework for Ruby
-EOF
- usa = <<-EOF
-RSpec is a
-behavior driven development
-framework for Ruby
-EOF
- usa.should == uk
- end
-
- class Animal
- def initialize(name,species)
- @name,@species = name,species
- end
-
- def inspect
- <<-EOA
-<Animal
-name=#{@name},
-species=#{@species}
->
- EOA
- end
- end
-
- it "should print diff of different objects' pretty representation" do
- expected = Animal.new "bob", "giraffe"
- actual = Animal.new "bob", "tortoise"
- expected.should eq(actual)
- end
-end
@@ -1,19 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-# Run spec w/ -fs to see the output of this file
-
-describe "Failing examples with no descriptions" do
-
- # description is auto-generated as "should equal(5)" based on the last #should
- it do
- 3.should equal(2)
- 5.should equal(5)
- end
-
- it { 3.should be > 5 }
-
- it { ["a"].should include("b") }
-
- it { [1,2,3].should_not respond_to(:size) }
-
-end
@@ -1,10 +0,0 @@
-describe "This example" do
-
- it "should be listed as failing in after" do
- end
-
- after(:each) do
- NonExistentClass.new
- end
-
-end
@@ -1,10 +0,0 @@
-describe "This example" do
-
- before(:each) do
- NonExistentClass.new
- end
-
- it "should be listed as failing in each" do
- end
-
-end
@@ -1,40 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe "Mocker" do
-
- it "should be able to call mock()" do
- mock = mock("poke me")
- mock.should_receive(:poke)
- mock.poke
- end
-
- it "should fail when expected message not received" do
- mock = mock("poke me")
- mock.should_receive(:poke)
- end
-
- it "should fail when messages are received out of order" do
- mock = mock("one two three")
- mock.should_receive(:one).ordered
- mock.should_receive(:two).ordered
- mock.should_receive(:three).ordered
- mock.one
- mock.three
- mock.two
- end
-
- it "should get yelled at when sending unexpected messages" do
- mock = mock("don't talk to me")
- mock.should_not_receive(:any_message_at_all)
- mock.any_message_at_all
- end
-
- it "has a bug we need to fix" do
- pending "here is the bug" do
- # Actually, no. It's fixed. This will fail because it passes :-)
- mock = mock("Bug")
- mock.should_receive(:hello)
- mock.hello
- end
- end
-end
@@ -1,26 +0,0 @@
-# stub frameworks like to gum up Object, so this is deliberately
-# set NOT to run so that you don't accidentally run it when you
-# run this dir.
-
-# To run it, stand in this directory and say:
-#
-# RUN_FLEXMOCK_EXAMPLE=true ruby ../bin/spec mocking_with_flexmock.rb
-
-if ENV['RUN_FLEXMOCK_EXAMPLE']
- Spec::Runner.configure do |config|
- config.mock_framework = :flexmock
- end
-
- describe "Flexmocks" do
- it "should fail when the expected message is received with wrong arguments" do
- m = flexmock("now flex!")
- m.should_receive(:msg).with("arg").once
- m.msg("other arg")
- end
-
- it "should fail when the expected message is not received at all" do
- m = flexmock("now flex!")
- m.should_receive(:msg).with("arg").once
- end
- end
-end
@@ -1,25 +0,0 @@
-# stub frameworks like to gum up Object, so this is deliberately
-# set NOT to run so that you don't accidentally run it when you
-# run this dir.
-
-# To run it, stand in this directory and say:
-#
-# RUN_MOCHA_EXAMPLE=true ruby ../bin/spec mocking_with_mocha.rb
-
-if ENV['RUN_MOCHA_EXAMPLE']
- Spec::Runner.configure do |config|
- config.mock_framework = :mocha
- end
- describe "Mocha framework" do
- it "should should be made available by saying config.mock_framework = :mocha" do
- m = mock()
- m.expects(:msg).with("arg")
- m.msg
- end
- it "should should be made available by saying config.mock_framework = :mocha" do
- o = Object.new
- o.expects(:msg).with("arg")
- o.msg
- end
- end
-end
@@ -1,27 +0,0 @@
-# stub frameworks like to gum up Object, so this is deliberately
-# set NOT to run so that you don't accidentally run it when you
-# run this dir.
-
-# To run it, stand in this directory and say:
-#
-# RUN_RR_EXAMPLE=true ruby ../bin/spec mocking_with_rr.rb
-
-if ENV['RUN_RR_EXAMPLE']
- Spec::Runner.configure do |config|
- config.mock_framework = :rr
- end
- describe "RR framework" do
- it "should should be made available by saying config.mock_framework = :rr" do
- o = Object.new
- mock(o).msg("arg")
- o.msg
- end
- it "should should be made available by saying config.mock_framework = :rr" do
- o = Object.new
- mock(o) do |m|
- m.msg("arg")
- end
- o.msg
- end
- end
-end
@@ -1,20 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-class MockableClass
- def self.find id
- return :original_return
- end
-end
-
-describe "A partial mock" do
-
- it "should work at the class level (but fail here due to the type mismatch)" do
- MockableClass.should_receive(:find).with(1).and_return {:stub_return}
- MockableClass.find("1").should equal(:stub_return)
- end
-
- it "should revert to the original after each spec" do
- MockableClass.find(1).should equal(:original_return)
- end
-
-end
@@ -1,9 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe "pending example (which is fixed)" do
- it %Q|reports "FIXED ... Expected ... to fail. No Error was raised."| do
- pending("for some reason") do
- # success
- end
- end
-end
@@ -1,34 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-class BddFramework
- def intuitive?
- true
- end
-
- def adopted_quickly?
- #this will cause failures because it reallly SHOULD be adopted quickly
- false
- end
-end
-
-describe "BDD framework" do
-
- before(:each) do
- @bdd_framework = BddFramework.new
- end
-
- it "should be adopted quickly" do
- #this will fail because it reallly SHOULD be adopted quickly
- @bdd_framework.should be_adopted_quickly
- end
-
- it "should be intuitive" do
- @bdd_framework.should be_intuitive
- end
-
- it "should not respond to test" do
- #this will fail
- @bdd_framework.test
- end
-
-end
@@ -1,47 +0,0 @@
-describe "This example" do
-
- it "should show that a NoMethodError is raised but an Exception was expected" do
- proc { ''.nonexistent_method }.should raise_error
- end
-
- it "should pass" do
- proc { ''.nonexistent_method }.should raise_error(NoMethodError)
- end
-
- it "should show that a NoMethodError is raised but a SyntaxError was expected" do
- proc { ''.nonexistent_method }.should raise_error(SyntaxError)
- end
-
- it "should show that nothing is raised when SyntaxError was expected" do
- proc { }.should raise_error(SyntaxError)
- end
-
- it "should show that a NoMethodError is raised but a Exception was expected" do
- proc { ''.nonexistent_method }.should_not raise_error
- end
-
- it "should show that a NoMethodError is raised" do
- proc { ''.nonexistent_method }.should_not raise_error(NoMethodError)
- end
-
- it "should also pass" do
- proc { ''.nonexistent_method }.should_not raise_error(SyntaxError)
- end
-
- it "should show that a NoMethodError is raised when nothing expected" do
- proc { ''.nonexistent_method }.should_not raise_error(Exception)
- end
-
- it "should show that the wrong message was received" do
- proc { raise StandardError.new("what is an enterprise?") }.should raise_error(StandardError, "not this")
- end
-
- it "should show that the unexpected error/message was thrown" do
- proc { raise StandardError.new("abc") }.should_not raise_error(StandardError, "abc")
- end
-
- it "should pass too" do
- proc { raise StandardError.new("abc") }.should_not raise_error(StandardError, "xyz")
- end
-
-end
@@ -1 +0,0 @@
-require File.expand_path('../../spec_helper.rb', __FILE__)
@@ -1,7 +0,0 @@
-describe "when passing a block to a matcher" do
- it "you should use {} instead of do/end" do
- Object.new.should satisfy do
- "this block is being passed to #should instead of #satisfy - use {} instead"
- end
- end
-end
@@ -1,43 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-class Team
- attr_reader :players
- def initialize
- @players = Players.new
- end
-end
-
-class Players
- def initialize
- @players = []
- end
- def size
- @players.size
- end
- def include? player
- raise "player must be a string" unless player.is_a?(String)
- @players.include? player
- end
-end
-
-describe "A new team" do
-
- before(:each) do
- @team = Team.new
- end
-
- it "should have 3 players (failing example)" do
- @team.should have(3).players
- end
-
- it "should include some player (failing example)" do
- @team.players.should include("Some Player")
- end
-
- it "should include 5 (failing example)" do
- @team.players.should include(5)
- end
-
- it "should have no players"
-
-end
@@ -1,7 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe "Something really slow" do
- it "should be failed by RSpec when it takes longer than --timeout" do
- sleep(2)
- end
-end
@@ -1,12 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-require 'spec/runner/formatter/progress_bar_formatter'
-
-# Example of a formatter with custom bactrace printing. Run me with:
-# ruby bin/spec examples/failing -r examples/passing/custom_formatter.rb -f CustomFormatter
-class CustomFormatter < Spec::Runner::Formatter::ProgressBarFormatter
- def backtrace_line(line)
- line.gsub(/([^:]*\.rb):(\d*)/) do
- "<a href=\"file://#{File.expand_path($1)}\">#{$1}:#{$2}</a> "
- end
- end
-end
Oops, something went wrong.

0 comments on commit 9aa73b5

Please sign in to comment.