Sha256: ed3de8d8a7caea96bc4571fdeac271c61a38f33b28af627bba2454b5ea2b07f5

Contents?: true

Size: 611 Bytes

Versions: 11

Compression:

Stored size: 611 Bytes

Contents

require 'active_resource'

module UnitTests
  module ActiveResourceBuilder
    def self.configure_example_group(example_group)
      example_group.include ActiveResourceBuilder

      example_group.after do
        ActiveSupport::Dependencies.clear
      end
    end

    def define_active_resource_class(class_name, attributes = {}, &block)
      define_class(class_name, ActiveResource::Base) do
        schema do
          attributes.each do |attr, type|
            attribute attr, type
          end
        end

        if block_given?
          class_eval(&block)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
shoulda-matchers-3.1.3 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.1.2 spec/support/unit/helpers/active_resource_builder.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/shoulda-matchers-2.8.0/spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.1.1 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.1.0 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.0.1 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.0.0 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-3.0.0.rc1 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-2.8.0 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-2.8.0.rc2 spec/support/unit/helpers/active_resource_builder.rb
shoulda-matchers-2.8.0.rc1 spec/support/unit/helpers/active_resource_builder.rb