diff options
author | Francis Irving <francis@mysociety.org> | 2009-12-02 17:56:17 +0000 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2009-12-02 17:56:17 +0000 |
commit | 1bbb3f950f8bee92bf8a39e6f18c3278f1bab11d (patch) | |
tree | 5d0312d5d00446cd1454a5e1c799cd89d57b10d6 /vendor/plugins/rspec/spec/autotest_matchers.rb | |
parent | 5f3139b538d1ff58b719a72d7c7cf05a5b6136b5 (diff) |
Changing rspec / rspec_on_rails version
Diffstat (limited to 'vendor/plugins/rspec/spec/autotest_matchers.rb')
-rw-r--r-- | vendor/plugins/rspec/spec/autotest_matchers.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/vendor/plugins/rspec/spec/autotest_matchers.rb b/vendor/plugins/rspec/spec/autotest_matchers.rb deleted file mode 100644 index 5e23452e2..000000000 --- a/vendor/plugins/rspec/spec/autotest_matchers.rb +++ /dev/null @@ -1,47 +0,0 @@ -module Spec - module Matchers - class AutotestMappingMatcher - def initialize(specs) - @specs = specs - end - - def to(file) - @file = file - self - end - - def matches?(autotest) - @autotest = prepare autotest - @actual = autotest.test_files_for(@file) - @actual == @specs - end - - def failure_message - "expected #{@autotest.class} to map #{@specs.inspect} to #{@file.inspect}\ngot #{@actual.inspect}" - end - - private - def prepare autotest - stub_found_files autotest - stub_find_order autotest - autotest - end - - def stub_found_files autotest - found_files = @specs.inject({}){|h,f| h[f] = Time.at(0)} - autotest.stub!(:find_files).and_return(found_files) - end - - def stub_find_order autotest - find_order = @specs.dup << @file - autotest.instance_eval { @find_order = find_order } - end - - end - - def map_specs(specs) - AutotestMappingMatcher.new(specs) - end - - end -end
\ No newline at end of file |