Sha256: ccc78ba339ddc6f0caedb5ec0c8aea8d698af6fd49c2df12dd1a49d197e59308

Contents?: true

Size: 1.32 KB

Versions: 16

Compression:

Stored size: 1.32 KB

Contents

=begin

#Fatture in Cloud API v2 - Filter Helper

=end

require 'spec_helper'

describe FattureInCloud_Ruby_Sdk::Conjunction do
  let(:left) { FattureInCloud_Ruby_Sdk::Condition.new('city', FattureInCloud_Ruby_Sdk::Operator::EQ, 'Bergamo') }
  let(:right) { FattureInCloud_Ruby_Sdk::Condition.new('age', FattureInCloud_Ruby_Sdk::Operator::LT, 35) }
  let(:c) { FattureInCloud_Ruby_Sdk::Conjunction.new(left, right) }
  let(:left1) { FattureInCloud_Ruby_Sdk::Condition.new('team', FattureInCloud_Ruby_Sdk::Operator::EQ, 'Volley Bergamo 1991') }
  let(:right1) { FattureInCloud_Ruby_Sdk::Condition.new('best_player', FattureInCloud_Ruby_Sdk::Operator::IS_NOT, 'null') }

  describe 'test an instance of Conjunction' do
    it 'should create an instance of Conjunction' do
      expect(c).to be_instance_of(FattureInCloud_Ruby_Sdk::Conjunction)
    end
  end

  describe 'test attribute "left"' do
    it 'should work' do
      expect(c.left).to eq(left)
      c.left = left1
      expect(c.left).to eq(left1)
    end
  end

  describe 'test attribute "right"' do
    it 'should work' do
      expect(c.right).to eq(right)
      c.right = right1
      expect(c.right).to eq(right1)
    end
  end

  describe 'test attribute "build_query"' do
    it 'should work' do
      expect(c.build_query).to eq("(city = 'Bergamo' and age < 35)")
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fattureincloud_ruby_sdk-2.1.1 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.1.0 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.20 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.19 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.18 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.17 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.16 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.15 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.14 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.13 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.12 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.11 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.10 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.9 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.8 spec/filter/conjunction_spec.rb
fattureincloud_ruby_sdk-2.0.7 spec/filter/conjunction_spec.rb