Sha256: b82b0690868340415319172b0c88bd065c06935eb2ca3283920ece9b97dd2346

Contents?: true

Size: 1.32 KB

Versions: 31

Compression:

Stored size: 1.32 KB

Contents

# Not needed anymore in ruby 2.0, but needed to resolve constants
# in nested namespaces. This is taken from rails :)
def constantize(camel_cased_word)
  names = camel_cased_word.split('::')
  names.shift if names.empty? || names.first.empty?

  constant = Object
  names.each do |name|
    constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
  end
  constant
end


Then /it should return an? (\w+)$/ do |class_string|
  @response_from_httparty.should be_an_instance_of(class_string.class)
end

Then /the return value should match '(.*)'/ do |expected_text|
  @response_from_httparty.should eql(expected_text)
end

Then /it should return a Hash equaling:/ do |hash_table|
  @response_from_httparty.should be_an_instance_of(Hash)
  @response_from_httparty.keys.length.should eql(hash_table.rows.length)
  hash_table.hashes.each do |pair|
    key, value = pair["key"], pair["value"]
    @response_from_httparty.keys.should include(key)
    @response_from_httparty[key].should eql(value)
  end
end

Then /it should return a response with a (\d+) response code/ do |code|
  @response_from_httparty.code.should eql(code.to_i)
end

Then /it should raise (?:an|a) ([\w:]+) exception/ do |exception|
  @exception_from_httparty.should_not be_nil
  @exception_from_httparty.should be_a constantize(exception)
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
plyom_user-0.3.1 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.3.0 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.9 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.8 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.7 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.6 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.5 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.4 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.3 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.2 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.1 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.2.0 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.9 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.8 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.7 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.6 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.5 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.4 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.3 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb
plyom_user-0.1.2 vendor/bundle/ruby/2.0.0/gems/httparty-0.11.0/features/steps/httparty_response_steps.rb