Sha256: 4f254ecf7a7c611e79d89e84c69b9e3cb8ea07a5299a0343cacb6d8e03e7ad69

Contents?: true

Size: 536 Bytes

Versions: 48

Compression:

Stored size: 536 Bytes

Contents

require 'spec_helper'

module AttrAccessorSpec
  module M
    attr_accessor :foo
  end

  class C
    include M
  end
end

describe "Module#attr_accessor" do
  it "can be passed a splat of arguments" do
    eval "class OpalAttrAccessorSpec; attr_accessor *%w{foo bar baz}; end"
    OpalAttrAccessorSpec.new.foo.should be_nil
  end

  describe "inside a module" do
    it "defines methods that get donated to a class when included" do
      obj = AttrAccessorSpec::C.new
      obj.foo = 100
      obj.foo.should == 100
    end
  end
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
opal-0.7.0.beta1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.6.2 spec/opal/core/module/attr_accessor_spec.rb
opal-0.6.1 spec/opal/core/module/attr_accessor_spec.rb
opal-0.6.0 spec/opal/core/module/attr_accessor_spec.rb
opal-0.5.5 spec/opal/core/module/attr_accessor_spec.rb
opal-0.5.4 spec/corelib/module/attr_accessor_spec.rb
opal-0.5.2 spec/corelib/module/attr_accessor_spec.rb
opal-0.5.0 spec/corelib/module/attr_accessor_spec.rb