blob: 13953078a08ad94dab6478562c922643b3834085 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# require 'spec_helper'
# describe Export, :type => :model do
# subject { create :export }
# RSpec::Matchers.define :be_log_message do |expected|
# match do |actual|
# actual and expected.all? { |k,v| actual[k.to_s] == v }
# end
# end
# describe "#export" do
# before(:each) do
# allow(subject).to receive_messages :exporter => double(:export => true)
# end
# it "should create a ExportLogmessage :started when started" do
# subject.export
# expect(subject.log_messages.first).to be_log_message(:key => "started")
# end
# it "should create a ExportLogmessage :completed when completed" do
# subject.export
# expect(subject.log_messages.last).to be_log_message(:key => "completed")
# end
# it "should create a ExportLogmessage :failed when failed" do
# pending
# # subject.loader.stub(:export).and_raise("export failed")
# subject.export
# expect(subject.log_messages.last).to be_log_message(:key => "failed")
# end
# end
# describe "#options" do
# it "should be empty by default" do
# expect(subject.options).to be_empty
# end
# end
# describe ".types" do
# it "should return available Export implementations" do
# expect(Export.types).to match_array(%w{NeptuneExport CsvExport GtfsExport NetexExport KmlExport HubExport})
# end
# end
# describe ".new" do
# it "should use type attribute to create a subclass" do
# expect(Export.new(:type => "NeptuneExport")).to be_an_instance_of(NeptuneExport)
# end
# end
# it_behaves_like TypeIdsModelable do
# let(:type_ids_model) { subject}
# end
# end
|