소스 검색

Evaluate strings

master
Dylan Baker 5 년 전
부모
커밋
f31ce80c4b
2개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 4
    0
      lib/chervil/ast/string.rb
  2. 7
    0
      spec/ast/string_spec.rb

+ 4
- 0
lib/chervil/ast/string.rb 파일 보기

@@ -9,5 +9,9 @@ module Chervil::AST
9 9
     def ==(other)
10 10
       @value == other.value
11 11
     end
12
+
13
+    def evaluate
14
+      @value
15
+    end
12 16
   end
13 17
 end

+ 7
- 0
spec/ast/string_spec.rb 파일 보기

@@ -0,0 +1,7 @@
1
+module Chervil::AST
2
+  RSpec.describe String do
3
+    it 'evaluates' do
4
+      expect(String.new("hello world").evaluate).to eq("hello world")
5
+    end
6
+  end
7
+end

Loading…
취소
저장