Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rails 2.3.2 tests run.

  • Loading branch information...
commit 01645c4e430647a72a388dd870cc249023b24f9b 1 parent b079cff
@aiwilliams authored
View
8 CHANGELOG
@@ -1,8 +1,12 @@
+*1.3.0 [Rails 2.3.2] (??)
+
+* Supporting Rails 2.3.2
+
*1.2.0 [Cucumber] (April 8, 2009)
* Support for cucumber [jgarber, seancribbs]
-
+
*1.1.0 [STI, belongs_to] (February 14, 2009)
* STI is better supported for inserting, naming and finding records [aiwilliams]
@@ -48,7 +52,7 @@
create_person(:name => 'Little John')
people(:little_john)
-
+
*1.0.0 [Scenarios Replacement] (December 15, 2008)
* Drop-in replacement for Scenarios plugin of old [aiwilliams]
View
4 plugit/descriptor.rb
@@ -9,12 +9,12 @@
dataset.environment :default, 'Released versions of Rails and RSpec' do |env|
env.library :rails, :export => "git clone git://github.com/rails/rails.git" do |rails|
- rails.after_update { `git fetch origin 2-2-stable:2-2-stable; git checkout 2-2-stable` }
+ rails.after_update { `git fetch origin 2-3-stable:2-3-stable; git checkout 2-3-stable` }
rails.load_paths = %w{/activesupport/lib /activerecord/lib /actionpack/lib}
rails.requires = %w{active_support active_record active_record/fixtures action_controller action_view}
end
env.library :rspec, :export => "git clone git://github.com/dchelimsky/rspec.git" do |rspec|
- rspec.after_update { `git checkout -b rspecrelease 1.1.11 && mkdir -p #{vendor_directory} && ln -nsf #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
+ rspec.after_update { `git checkout -b rspecrelease 1.1.12 && mkdir -p #{vendor_directory} && ln -nsf #{File.expand_path('.')} #{vendor_directory + '/rspec'}` }
rspec.requires = %w{spec}
end
env.library :cucumber, :export => "git clone git://github.com/aslakhellesoy/cucumber.git" do |cukes|
View
216 spec/dataset/rspec_spec.rb
@@ -5,133 +5,129 @@ class Spec::Example::ExampleGroup
end
describe Spec::Example::ExampleGroup do
- include SandboxedOptions
-
- it 'should have a dataset method' do
- group = Class.new(Spec::Example::ExampleGroup)
- group.should respond_to(:dataset)
- end
-
- it 'should load the dataset when the group is run' do
- load_count = 0
- dataset = Class.new(Dataset::Base) do
- define_method(:load) do
- load_count += 1
- end
- end
-
- group = Class.new(Spec::Example::ExampleGroup) do
- self.dataset(dataset)
- it('one') {}
- it('two') {}
+ with_sandboxed_options do
+ it 'should have a dataset method' do
+ group = Class.new(Spec::Example::ExampleGroup)
+ group.should respond_to(:dataset)
end
- group.run
- load_count.should be(1)
- end
-
- it 'should load datasets in nested groups' do
- dataset_one = Class.new(Dataset::Base) do
- define_method(:load) do
- Thing.create!
+ it 'should load the dataset when the group is run' do
+ load_count = 0
+ dataset = Class.new(Dataset::Base) do
+ define_method(:load) do
+ load_count += 1
+ end
end
- end
- dataset_two = Class.new(Dataset::Base) do
- define_method(:load) do
- Place.create!
+
+ group = Class.new(Spec::Example::ExampleGroup) do
+ self.dataset(dataset)
+ it('one') {}
+ it('two') {}
end
+
+ group.run options
+ load_count.should be(1)
end
- group = Class.new(Spec::Example::ExampleGroup) do
- dataset(dataset_one)
- it('one') {}
- end
- group_child = Class.new(group) do
- dataset(dataset_two)
- it('two') {}
- end
-
- group.run
- Thing.count.should be(1)
- Place.count.should be(0)
-
- group_child.run
- Thing.count.should be(1)
- Place.count.should be(1)
- end
-
- it 'should expose data reading methods from dataset binding to the test methods through the group instances' do
- created_model = nil
- dataset = Class.new(Dataset::Base) do
- define_method(:load) do
- created_model = create_model(Thing, :dataset_thing)
+ it 'should load datasets in nested groups' do
+ dataset_one = Class.new(Dataset::Base) do
+ define_method(:load) do
+ Thing.create!
+ end
end
- end
-
- found_in_before_all, dataset_thing_in_example = nil
- created_in_before_all, before_all_thing_in_example = nil
- created_in_example = nil
- group = Class.new(Spec::Example::ExampleGroup) do
- self.dataset(dataset)
- before(:all) do
- found_in_before_all = things(:dataset_thing)
- created_in_before_all = create_model(Thing, :before_all_thing)
+ dataset_two = Class.new(Dataset::Base) do
+ define_method(:load) do
+ Place.create!
+ end
+ end
+
+ group = Class.new(Spec::Example::ExampleGroup) do
+ dataset(dataset_one)
+ it('one') {}
end
- it 'one' do
- dataset_thing_in_example = things(:dataset_thing)
- before_all_thing_in_example = things(:before_all_thing)
- created_in_example = create_model(Thing)
+ group_child = Class.new(group) do
+ dataset(dataset_two)
+ it('two') {}
end
+
+ group.run options
+ Thing.count.should be(1)
+ Place.count.should be(0)
+
+ group_child.run options
+ Thing.count.should be(1)
+ Place.count.should be(1)
end
- group.run
- group.should_not respond_to(:things)
-
- dataset_thing_in_example.should_not be_nil
- dataset_thing_in_example.should == created_model
-
- found_in_before_all.should_not be_nil
- found_in_before_all.should == created_model
-
- created_in_before_all.should_not be_nil
- before_all_thing_in_example.should == created_in_before_all
-
- created_in_example.should_not be_nil
- end
-
- it 'should expose dataset helper methods to the test methods through the group instances' do
- dataset_one = Class.new(Dataset::Base) do
- helpers do
- def helper_one; end
+ it 'should expose data reading methods from dataset binding to the test methods through the group instances' do
+ created_model = nil
+ dataset = Class.new(Dataset::Base) do
+ define_method(:load) do
+ created_model = create_model(Thing, :dataset_thing)
+ end
end
- def load; end
- end
- dataset_two = Class.new(Dataset::Base) do
- uses dataset_one
- helpers do
- def helper_two; end
+
+ found_in_before_all, dataset_thing_in_example = nil
+ created_in_before_all, before_all_thing_in_example = nil
+ created_in_example = nil
+ group = Class.new(Spec::Example::ExampleGroup) do
+ self.dataset(dataset)
+ before(:all) do
+ found_in_before_all = things(:dataset_thing)
+ created_in_before_all = create_model(Thing, :before_all_thing)
+ end
+ it 'one' do
+ dataset_thing_in_example = things(:dataset_thing)
+ before_all_thing_in_example = things(:before_all_thing)
+ created_in_example = create_model(Thing)
+ end
end
- def load; end
+
+ group.run options
+ group.should_not respond_to(:things)
+
+ dataset_thing_in_example.should_not be_nil
+ dataset_thing_in_example.should == created_model
+
+ found_in_before_all.should_not be_nil
+ found_in_before_all.should == created_model
+
+ created_in_before_all.should_not be_nil
+ before_all_thing_in_example.should == created_in_before_all
+
+ created_in_example.should_not be_nil
end
- group_before_all_instance, group_example_instance = nil
- group = Class.new(Spec::Example::ExampleGroup) do
- self.dataset(dataset_two)
- before(:all) do
- group_before_all_instance = self
+ it 'should expose dataset helper methods to the test methods through the group instances' do
+ dataset_one = Class.new(Dataset::Base) do
+ helpers do
+ def helper_one; end
+ end
+ def load; end
+ end
+ dataset_two = Class.new(Dataset::Base) do
+ uses dataset_one
+ helpers do
+ def helper_two; end
+ end
+ def load; end
end
- it 'one' do
- group_example_instance = self
+
+ group = Class.new(Spec::Example::ExampleGroup) do
+ self.dataset(dataset_two)
+ before(:all) do
+ self.should respond_to(:helper_one)
+ self.should respond_to(:helper_two)
+ end
+ it 'one' do
+ self.should respond_to(:helper_one)
+ self.should respond_to(:helper_two)
+ end
end
+
+ group.run options
+ group.should_not respond_to(:helper_one)
+ group.should_not respond_to(:helper_two)
end
-
- group.run
-
- group.should_not respond_to(:helper_one)
- group.should_not respond_to(:helper_two)
- group_before_all_instance.should respond_to(:helper_one)
- group_before_all_instance.should respond_to(:helper_two)
- group_example_instance.should respond_to(:helper_one)
- group_example_instance.should respond_to(:helper_two)
end
end
View
1  spec/dataset/test_unit_spec.rb
@@ -202,6 +202,7 @@ def load; end
def run_testcase(testcase)
result = Test::Unit::TestResult.new
+ testcase.module_eval { def test_dont_complain; end }
testcase.suite.run(result) {}
result.failure_count.should be(0)
result.error_count.should be(0)
View
15 spec/spec_helper.rb
@@ -1,23 +1,20 @@
SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
require "#{SPEC_ROOT}/../plugit/descriptor"
-# From RSpec's spec_helper.rb. Useful to keep testing of ExampleGroup from
-# being overly noisy in the console output.
-share_as :SandboxedOptions do
+# From RSpec's spec_helper.rb. Necessary to run an example group.
+def with_sandboxed_options
attr_reader :options
-
+
before(:each) do
@original_rspec_options = ::Spec::Runner.options
::Spec::Runner.use(@options = ::Spec::Runner::Options.new(StringIO.new, StringIO.new))
end
-
+
after(:each) do
::Spec::Runner.use(@original_rspec_options)
end
-
- def run_with(options)
- ::Spec::Runner::CommandLine.run(options)
- end
+
+ yield
end
$LOAD_PATH << SPEC_ROOT
Please sign in to comment.
Something went wrong with that request. Please try again.