Use Devtools.init_spec_helper

This commit is contained in:
Markus Schirp 2013-03-01 18:46:33 +01:00
parent b8ac5ecbf4
commit 40240b0673
6 changed files with 2 additions and 59 deletions

View file

@ -1,7 +0,0 @@
# encoding: utf-8
shared_examples_for 'a command method' do
it 'returns self' do
should equal(object)
end
end

View file

@ -1,15 +0,0 @@
# encoding: utf-8
shared_examples_for 'an #each method' do
it_should_behave_like 'a command method'
context 'with no block' do
subject { object.each }
it { should be_instance_of(to_enum.class) }
it 'yields the expected values' do
subject.to_a.should eql(object.to_a)
end
end
end

View file

@ -1,17 +0,0 @@
# encoding: utf-8
shared_examples_for 'a hash method' do
it_should_behave_like 'an idempotent method'
specification = proc do
should be_instance_of(Fixnum)
end
it 'is a fixnum' do
instance_eval(&specification)
end
it 'memoizes the hash code' do
subject.should eql(object.memoized(:hash))
end
end

View file

@ -1,7 +0,0 @@
# encoding: utf-8
shared_examples_for 'an idempotent method' do
it 'is idempotent' do
should equal(instance_eval(&self.class.subject))
end
end

View file

@ -1,9 +0,0 @@
# encoding: utf-8
shared_examples_for 'an invertible method' do
it_should_behave_like 'an idempotent method'
it 'is invertible' do
subject.inverse.should equal(object)
end
end

View file

@ -1,9 +1,7 @@
# encoding: utf-8
require 'rspec'
# require spec support files and shared behavior
Dir[File.expand_path('../{support,shared}/**/*.rb', __FILE__)].each { |f| require(f) }
require 'devtools'
Devtools.init_spec_helper
$: << File.join(TestApp.root,'lib')