Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let(:client) { Rubyidescat::Client.new }
- describe 'poblacio' do
- it 'should set format correctly' do
- client.poblacio('v1','json','dades')
- expect (client.instance_variable_get(:format)).to be_equal('json')
- end
- end
- module Rubyidescat
- class Client
- BASE_URL = 'http://api.idescat.cat/'
- def initialize(attributes = {})
- attributes.each do |attr, value|
- self.send("#{attr}=", value)
- end
- end
- def poblacio version, format, operation, *args
- @format = format
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment