Commit 855c970808ddc9888652bd1177f83a913d1d79d1

Remove files left over from updating rspec.

Commit diff

vendor/plugins/rspec/autotest/discover.rb

 
0# Used just for us to develop rspec with Autotest
1# We could symbolic link rspec/vendor/plugins/rspec => rspec/., but
2# this leads to a problem with subversion on windows. Autotest
3# uses Ruby's load path, which contains ".", so this is a workaround
4# (albeit, an unclean one)
5require File.dirname(__FILE__) + "/../lib/autotest/discover.rb"
toggle raw diff

vendor/plugins/rspec/autotest/rspec.rb

 
0require File.dirname(__FILE__) + "/../lib/autotest/rspec.rb"
toggle raw diff

vendor/plugins/rspec/spec.opts

 
0--colour
1--format
2profile
3--timeout
420
5--diff
toggle raw diff

vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec_with_test_unit.rb

 
0require "test/unit"
1require File.dirname(__FILE__) + '/../../../../spec_helper.rb'
2
3describe "TestCase#method_name" do
4 it "should equal the description of the example" do
5 @method_name.should == "should equal the description of the example"
6 end
7
8 def test_this
9 true.should be_true
10 end
11
12 def testThis
13 true.should be_true
14 end
15
16 def testament
17 raise "testament is not a test"
18 end
19end
toggle raw diff

vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec_with_test_unit.rb

 
0require "test/unit"
1require File.dirname(__FILE__) + '/../../../../spec_helper.rb'
2
3module TestSuiteAdapterSpecHelper
4 def create_adapter(group)
5 Test::Unit::TestSuiteAdapter.new(group)
6 end
7end
8
9describe "TestSuiteAdapter#size" do
10 include TestSuiteAdapterSpecHelper
11 it "should return the number of examples in the example group" do
12 group = Class.new(Spec::ExampleGroup) do
13 describe("some examples")
14 it("bar") {}
15 it("baz") {}
16 end
17 adapter = create_adapter(group)
18 adapter.size.should == 2
19 end
20end
21
22describe "TestSuiteAdapter#delete" do
23 include TestSuiteAdapterSpecHelper
24 it "should do nothing" do
25 group = Class.new(Spec::ExampleGroup) do
26 describe("Some Examples")
27 it("does something") {}
28 end
29 adapter = create_adapter(group)
30 adapter.delete(adapter.examples.first)
31 adapter.should be_empty
32 end
33end
toggle raw diff

vendor/plugins/rspec/spec/spec/mocks/bug_report_10263.rb

 
0describe "Mock" do
1 before do
2 @mock = mock("test mock")
3 end
4
5 specify "when one example has an expectation (non-mock) inside the block passed to the mock" do
6 @mock.should_receive(:msg) do |b|
7 b.should be_true #this call exposes the problem
8 end
9 @mock.msg(false) rescue nil
10 end
11
12 specify "then the next example should behave as expected instead of saying" do
13 @mock.should_receive(:foobar)
14 @mock.foobar
15 @mock.rspec_verify
16 begin
17 @mock.foobar
18 rescue => e
19 e.message.should == "Mock 'test mock' received unexpected message :foobar with (no args)"
20 end
21 end
22end
23
toggle raw diff

vendor/plugins/rspec_on_rails/generators/helpers/rails_identifier.rb

 
0module RailsIdentifier
1 class << self
2 def using_legacy_templates?
3 # Rails <= 2.0.1
4 if ActionView::Base.const_defined?('DEFAULT_TEMPLATE_HANDLER_PREFERENCE') &&
5 ActionView::Base::DEFAULT_TEMPLATE_HANDLER_PREFERENCE.include?(:erb)
6 return false
7 # Rails > 2.0.1
8 elsif ActionView::Base.respond_to?(:handler_for_extension) &&
9 ActionView::Base.handler_for_extension(:erb) == ActionView::TemplateHandlers::ERB then
10 return false
11 end
12 true
13 end
14 end
15end
toggle raw diff

vendor/plugins/rspec_on_rails/lib/spec/rails/example/ivar_proxy.rb

 
0##
1# A wrapper that allows instance variables to be manipulated using +[]+ and
2# +[]=+
3
4module Spec
5 module Rails
6 module Example
7 class IvarProxy #:nodoc:
8
9 ##
10 # Wraps +object+ allowing its instance variables to be manipulated.
11
12 def initialize(object)
13 @object = object
14 end
15
16 ##
17 # Retrieves +ivar+ from the wrapped object.
18
19 def [](ivar)
20 get_variable "@#{ivar}"
21 end
22
23 ##
24 # Sets +ivar+ to +val+ on the wrapped object.
25
26 def []=(ivar, val)
27 set_variable "@#{ivar}", val
28 end
29
30 def each
31 @object.instance_variables.each do |variable_full_name|
32 variable_name = variable_full_name[1...variable_full_name.length]
33 yield variable_name, get_variable(variable_full_name)
34 end
35 end
36
37 def delete(key)
38 var_name = "@#{key}"
39 if @object.instance_variables.include?(var_name)
40 @object.send(:remove_instance_variable, var_name)
41 else
42 return nil
43 end
44 end
45
46 def has_key?(key)
47 @object.instance_variables.include?("@#{key}")
48 end
49
50 protected
51 def get_variable(name)
52 @object.instance_variable_get name
53 end
54
55 def set_variable(name, value)
56 @object.instance_variable_set name, value
57 end
58 end
59 end
60 end
61end
toggle raw diff

vendor/plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb

 
0require File.dirname(__FILE__) + '/../../spec_helper'
1
2describe "IvarProxy setup", :shared => true do
3 before do
4 @object = Object.new
5 @proxy = Spec::Rails::Example::IvarProxy.new(@object)
6 end
7end
8
9describe "IvarProxy" do
10 it_should_behave_like "IvarProxy setup"
11
12 it "has [] accessor" do
13 @proxy['foo'] = 'bar'
14 @object.instance_variable_get(:@foo).should == 'bar'
15 @proxy['foo'].should == 'bar'
16 end
17
18 it "iterates through each element like a Hash" do
19 values = {
20 'foo' => 1,
21 'bar' => 2,
22 'baz' => 3
23 }
24 @proxy['foo'] = values['foo']
25 @proxy['bar'] = values['bar']
26 @proxy['baz'] = values['baz']
27
28 @proxy.each do |key, value|
29 key.should == key
30 value.should == values[key]
31 end
32 end
33
34 it "detects the presence of a key" do
35 @proxy['foo'] = 'bar'
36 @proxy.has_key?('foo').should == true
37 @proxy.has_key?('bar').should == false
38 end
39end
40
41describe "IvarProxy", "#delete" do
42 it_should_behave_like "IvarProxy setup"
43
44 it "deletes the element with key" do
45 @proxy['foo'] = 'bar'
46 @proxy.delete('foo').should == 'bar'
47 @proxy['foo'].should be_nil
48 end
49
50 it "deletes nil instance variables" do
51 @proxy['foo'] = nil
52 @object.instance_variables.should include("@foo")
53 @proxy.delete('foo').should == nil
54 @proxy['foo'].should be_nil
55 @object.instance_variables.should_not include("@foo")
56 end
57
58 it "returns nil when key does not exist" do
59 @proxy['foo'].should be_nil
60 @proxy.delete('foo').should == nil
61 @proxy['foo'].should be_nil
62 end
63end
toggle raw diff