spec/fx/definition_spec.rb in fx-0.7.0 vs spec/fx/definition_spec.rb in fx-0.8.0

- old
+ new

@@ -23,11 +23,11 @@ allow(File).to receive(:read).and_return("") definition = Fx::Definition.new(name: "test", version: 1) expect { definition.to_sql }.to raise_error( RuntimeError, - %r(Define function in db/functions/test_v01.sql before migrating), + %r{Define function in db/functions/test_v01.sql before migrating} ) end context "when definition is at Rails engine" do it "returns the content of a function definition" do @@ -57,34 +57,34 @@ it "returns the content of a trigger definition" do sql_definition = <<-EOS CREATE TRIGGER check_update BEFORE UPDATE ON accounts FOR EACH ROW - EXECUTE PROCEDURE check_account_update(); + EXECUTE FUNCTION check_account_update(); EOS allow(File).to receive(:read).and_return(sql_definition) definition = Fx::Definition.new( name: "test", version: 1, - type: "trigger", + type: "trigger" ) expect(definition.to_sql).to eq sql_definition end it "raises an error if the file is empty" do allow(File).to receive(:read).and_return("") definition = Fx::Definition.new( name: "test", version: 1, - type: "trigger", + type: "trigger" ) expect { definition.to_sql }.to raise_error( RuntimeError, - %r(Define trigger in db/triggers/test_v01.sql before migrating), + %r{Define trigger in db/triggers/test_v01.sql before migrating} ) end end end @@ -100,10 +100,10 @@ context "representing a trigger definition" do it "returns a sql file with padded version and trigger name" do definition = Fx::Definition.new( name: "test", version: 1, - type: "trigger", + type: "trigger" ) expect(definition.path).to eq "db/triggers/test_v01.sql" end end