Sha256: 48c3594080a3da0e7c0692fd7968a24b204d53f43461e588a83a1848ad52fd57

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

module RSpec::Core
  RSpec.describe 'Opal MemoizedHelpers' do
    before(:each) { RSpec.configuration.configure_expectation_framework }

    context "using 'self' as an explicit subject" do
      it "delegates matcher to the ExampleGroup" do
        group = ExampleGroup.describe("group") do
          subject { self }
          def ok?; true; end
          def not_ok?; false; end

          it { is_expected.to eq(self) }
          it { is_expected.to be_ok }
          it { is_expected.to_not be_not_ok }
        end

        #expect(group.run).to be true
        expect(group.run).to be_a Promise
        expect(group.run.value).to be_truthy
      end

      it 'supports a new expect-based syntax' do
        group = ExampleGroup.describe([1, 2, 3]) do
          it { is_expected.to be_an Array }
          it { is_expected.not_to include 4 }
        end

        #expect(group.run).to be true
        expect(group.run).to be_a Promise
        expect(group.run.value).to be_truthy
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-rspec-0.7.0.rc.1 spec-opal-rspec/core/memoized_helpers_spec.rb