Sha256: 5e86c679e642589f8a35f4dd3878f780fb5a3804e7cf358e321dd129e2d8a6db
Contents?: true
Size: 1.36 KB
Versions: 7
Compression:
Stored size: 1.36 KB
Contents
require "spec_helper" require "fx/trigger" module Fx describe Trigger do describe "#<=>" do it "delegates to `name`" do trigger_a = Trigger.new( "name" => "name_a", "definition" => "some defintion", ) trigger_b = Trigger.new( "name" => "name_b", "definition" => "some defintion", ) trigger_c = Trigger.new( "name" => "name_c", "definition" => "some defintion", ) expect(trigger_b).to be_between(trigger_a, trigger_c) end end describe "#==" do it "compares `name` and `definition`" do trigger_a = Trigger.new( "name" => "name_a", "definition" => "some defintion", ) trigger_b = Trigger.new( "name" => "name_b", "definition" => "some other defintion", ) expect(trigger_a).not_to eq(trigger_b) end end describe "#to_schema" do it "returns a schema compatible version of the trigger" do trigger = Trigger.new( "name" => "uppercase_users_name", "definition" => "CREATE TRIGGER uppercase_users_name ...", ) expect(trigger.to_schema).to eq <<-EOS create_trigger :uppercase_users_name, sql_definition: <<-\SQL CREATE TRIGGER uppercase_users_name ... SQL EOS end end end end
Version data entries
7 entries across 7 versions & 2 rubygems