aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/plugins/rspec/examples/failing
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/plugins/rspec/examples/failing')
-rw-r--r--vendor/plugins/rspec/examples/failing/README.txt11
-rw-r--r--vendor/plugins/rspec/examples/failing/diffing_spec.rb36
-rw-r--r--vendor/plugins/rspec/examples/failing/failing_implicit_docstrings_example.rb17
-rw-r--r--vendor/plugins/rspec/examples/failing/failure_in_after.rb10
-rw-r--r--vendor/plugins/rspec/examples/failing/failure_in_before.rb10
-rw-r--r--vendor/plugins/rspec/examples/failing/mocking_example.rb38
-rw-r--r--vendor/plugins/rspec/examples/failing/mocking_with_flexmock.rb26
-rw-r--r--vendor/plugins/rspec/examples/failing/mocking_with_mocha.rb25
-rw-r--r--vendor/plugins/rspec/examples/failing/mocking_with_rr.rb27
-rw-r--r--vendor/plugins/rspec/examples/failing/partial_mock_example.rb18
-rw-r--r--vendor/plugins/rspec/examples/failing/pending_example.rb7
-rw-r--r--vendor/plugins/rspec/examples/failing/predicate_example.rb32
-rw-r--r--vendor/plugins/rspec/examples/failing/raising_example.rb47
-rw-r--r--vendor/plugins/rspec/examples/failing/syntax_error_example.rb7
-rw-r--r--vendor/plugins/rspec/examples/failing/team_spec.rb41
-rw-r--r--vendor/plugins/rspec/examples/failing/timeout_behaviour.rb5
16 files changed, 0 insertions, 357 deletions
diff --git a/vendor/plugins/rspec/examples/failing/README.txt b/vendor/plugins/rspec/examples/failing/README.txt
deleted file mode 100644
index 7e9f49236..000000000
--- a/vendor/plugins/rspec/examples/failing/README.txt
+++ /dev/null
@@ -1,11 +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 the root directory and
-run:
-
-bin/spec examples/failing/*.rb \ No newline at end of file
diff --git a/vendor/plugins/rspec/examples/failing/diffing_spec.rb b/vendor/plugins/rspec/examples/failing/diffing_spec.rb
deleted file mode 100644
index 85e13e8c0..000000000
--- a/vendor/plugins/rspec/examples/failing/diffing_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-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 eql(actual)
- end
-end
diff --git a/vendor/plugins/rspec/examples/failing/failing_implicit_docstrings_example.rb b/vendor/plugins/rspec/examples/failing/failing_implicit_docstrings_example.rb
deleted file mode 100644
index 7b0b86614..000000000
--- a/vendor/plugins/rspec/examples/failing/failing_implicit_docstrings_example.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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
diff --git a/vendor/plugins/rspec/examples/failing/failure_in_after.rb b/vendor/plugins/rspec/examples/failing/failure_in_after.rb
deleted file mode 100644
index a47338aee..000000000
--- a/vendor/plugins/rspec/examples/failing/failure_in_after.rb
+++ /dev/null
@@ -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
diff --git a/vendor/plugins/rspec/examples/failing/failure_in_before.rb b/vendor/plugins/rspec/examples/failing/failure_in_before.rb
deleted file mode 100644
index b0826604e..000000000
--- a/vendor/plugins/rspec/examples/failing/failure_in_before.rb
+++ /dev/null
@@ -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
diff --git a/vendor/plugins/rspec/examples/failing/mocking_example.rb b/vendor/plugins/rspec/examples/failing/mocking_example.rb
deleted file mode 100644
index 9c735e00b..000000000
--- a/vendor/plugins/rspec/examples/failing/mocking_example.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-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
diff --git a/vendor/plugins/rspec/examples/failing/mocking_with_flexmock.rb b/vendor/plugins/rspec/examples/failing/mocking_with_flexmock.rb
deleted file mode 100644
index 6e79ece0e..000000000
--- a/vendor/plugins/rspec/examples/failing/mocking_with_flexmock.rb
+++ /dev/null
@@ -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_with :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
diff --git a/vendor/plugins/rspec/examples/failing/mocking_with_mocha.rb b/vendor/plugins/rspec/examples/failing/mocking_with_mocha.rb
deleted file mode 100644
index f14a1a3e5..000000000
--- a/vendor/plugins/rspec/examples/failing/mocking_with_mocha.rb
+++ /dev/null
@@ -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_with :mocha
- end
- describe "Mocha framework" do
- it "should should be made available by saying config.mock_with :mocha" do
- m = mock()
- m.expects(:msg).with("arg")
- m.msg
- end
- it "should should be made available by saying config.mock_with :mocha" do
- o = Object.new
- o.expects(:msg).with("arg")
- o.msg
- end
- end
-end
diff --git a/vendor/plugins/rspec/examples/failing/mocking_with_rr.rb b/vendor/plugins/rspec/examples/failing/mocking_with_rr.rb
deleted file mode 100644
index 0d2b4fe04..000000000
--- a/vendor/plugins/rspec/examples/failing/mocking_with_rr.rb
+++ /dev/null
@@ -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_with :rr
- end
- describe "RR framework" do
- it "should should be made available by saying config.mock_with :rr" do
- o = Object.new
- mock(o).msg("arg")
- o.msg
- end
- it "should should be made available by saying config.mock_with :rr" do
- o = Object.new
- mock(o) do |m|
- m.msg("arg")
- end
- o.msg
- end
- end
-end
diff --git a/vendor/plugins/rspec/examples/failing/partial_mock_example.rb b/vendor/plugins/rspec/examples/failing/partial_mock_example.rb
deleted file mode 100644
index 7f8d081b1..000000000
--- a/vendor/plugins/rspec/examples/failing/partial_mock_example.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-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
diff --git a/vendor/plugins/rspec/examples/failing/pending_example.rb b/vendor/plugins/rspec/examples/failing/pending_example.rb
deleted file mode 100644
index 825af2ed1..000000000
--- a/vendor/plugins/rspec/examples/failing/pending_example.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-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
diff --git a/vendor/plugins/rspec/examples/failing/predicate_example.rb b/vendor/plugins/rspec/examples/failing/predicate_example.rb
deleted file mode 100644
index aed8b14bd..000000000
--- a/vendor/plugins/rspec/examples/failing/predicate_example.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-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
diff --git a/vendor/plugins/rspec/examples/failing/raising_example.rb b/vendor/plugins/rspec/examples/failing/raising_example.rb
deleted file mode 100644
index e40b51ec8..000000000
--- a/vendor/plugins/rspec/examples/failing/raising_example.rb
+++ /dev/null
@@ -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
diff --git a/vendor/plugins/rspec/examples/failing/syntax_error_example.rb b/vendor/plugins/rspec/examples/failing/syntax_error_example.rb
deleted file mode 100644
index c9bb90774..000000000
--- a/vendor/plugins/rspec/examples/failing/syntax_error_example.rb
+++ /dev/null
@@ -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
diff --git a/vendor/plugins/rspec/examples/failing/team_spec.rb b/vendor/plugins/rspec/examples/failing/team_spec.rb
deleted file mode 100644
index ab35b5274..000000000
--- a/vendor/plugins/rspec/examples/failing/team_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-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
diff --git a/vendor/plugins/rspec/examples/failing/timeout_behaviour.rb b/vendor/plugins/rspec/examples/failing/timeout_behaviour.rb
deleted file mode 100644
index 1a3615ff0..000000000
--- a/vendor/plugins/rspec/examples/failing/timeout_behaviour.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-describe "Something really slow" do
- it "should be failed by RSpec when it takes longer than --timeout" do
- sleep(2)
- end
-end